From 111396c11d841ae7fd63c85b85c4219e151eaeff Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 14 Oct 2019 13:50:48 -0500 Subject: tests: Include fstab output in mount tests --- tests/spec/simulator.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'tests/spec') diff --git a/tests/spec/simulator.rb b/tests/spec/simulator.rb index 1b51b9d..013a3ec 100644 --- a/tests/spec/simulator.rb +++ b/tests/spec/simulator.rb @@ -37,20 +37,29 @@ RSpec.describe 'HorizonScript Simulator', :type => :aruba do it "mounts directories in tree order" do use_fixture '0057-many-mounts.installfile' run_simulate - expect(last_command_started.stdout).to include(" -mount /dev/sda1 /target/ + expect(last_command_started.stdout).to include("mount /dev/sda1 /target/ +mkdir -p /target/etc +printf '%s\\t%s\\t%s\\t%s\\t0\\t1\\n' /dev/sda1 / auto defaults >> /target/etc/fstab mount /dev/gwyn/home /target/home +printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/gwyn/home /home auto defaults >> /target/etc/fstab mount /dev/sda2 /target/usr -mount /dev/gwyn/source /target/usr/src") +printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/sda2 /usr auto defaults >> /target/etc/fstab +mount /dev/gwyn/source /target/usr/src +printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/gwyn/source /usr/src auto defaults >> /target/etc/fstab") end it "handles options correctly" do use_fixture '0075-mount-options.installfile' run_simulate expect(last_command_started.stdout).to include(" mount /dev/sda1 /target/ +mkdir -p /target/etc +printf '%s\\t%s\\t%s\\t%s\\t0\\t1\\n' /dev/sda1 / auto defaults >> /target/etc/fstab mount -o relatime /dev/gwyn/home /target/home +printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/gwyn/home /home auto relatime >> /target/etc/fstab mount /dev/sda2 /target/usr -mount -o noatime /dev/gwyn/source /target/usr/src") +printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/sda2 /usr auto defaults >> /target/etc/fstab +mount -o noatime /dev/gwyn/source /target/usr/src +printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/gwyn/source /usr/src auto noatime >> /target/etc/fstab") end end context "simulating 'hostname' execution" do -- cgit v1.2.3-60-g2f50