summaryrefslogtreecommitdiff
path: root/tests/spec/simulator_spec.rb
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-04 19:55:38 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-04 19:55:38 -0600
commit1ba765b5c71329767d281b94ef1b26661c323b5d (patch)
tree8294b1ce166982f05b2afba0015d8ae5a98dacba /tests/spec/simulator_spec.rb
parentc4e2d2373bed23f56ab8b96fc028ffb1c5c56001 (diff)
downloadhorizon-1ba765b5c71329767d281b94ef1b26661c323b5d.tar.gz
horizon-1ba765b5c71329767d281b94ef1b26661c323b5d.tar.bz2
horizon-1ba765b5c71329767d281b94ef1b26661c323b5d.tar.xz
horizon-1ba765b5c71329767d281b94ef1b26661c323b5d.zip
tests: Add tests for all supported FSes
Diffstat (limited to 'tests/spec/simulator_spec.rb')
-rw-r--r--tests/spec/simulator_spec.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/spec/simulator_spec.rb b/tests/spec/simulator_spec.rb
index 8c8e91a..d46c87c 100644
--- a/tests/spec/simulator_spec.rb
+++ b/tests/spec/simulator_spec.rb
@@ -27,6 +27,23 @@ RSpec.describe 'HorizonScript Simulator', :type => :aruba do
expect(last_command_started.stdout).to start_with("#!/bin/sh")
end
end
+ context "simulating 'disklabel' execution" do
+ it "creates Apple Partition Maps correctly" do
+ use_fixture '0122-disklabel-apm.installfile'
+ run_simulate
+ expect(last_command_started.stdout).to include("parted -ms /dev/sda mklabel apm")
+ end
+ it "creates GUID Partition Tables correctly" do
+ use_fixture '0124-disklabel-gpt.installfile'
+ run_simulate
+ expect(last_command_started.stdout).to include("parted -ms /dev/sda mklabel gpt")
+ end
+ it "creates MBR tables correctly" do
+ use_fixture '0123-disklabel-mbr.installfile'
+ run_simulate
+ expect(last_command_started.stdout).to include("parted -ms /dev/sda mklabel mbr")
+ end
+ end
context "simulating 'lvm_pv' execution" do
it "creates a physical volume" do
use_fixture '0163-lvmpv-basic.installfile'
@@ -49,11 +66,36 @@ RSpec.describe 'HorizonScript Simulator', :type => :aruba do
end
end
context "simulating 'fs' execution" do
+ it "creates ext2 filesystems correctly" do
+ use_fixture '0193-fs-ext2.installfile'
+ run_simulate
+ expect(last_command_started.stdout).to include("mkfs.ext2 -q -z /tmp/undo-sdb1 /dev/sdb1")
+ end
+ it "creates ext3 filesystems correctly" do
+ use_fixture '0194-fs-ext3.installfile'
+ run_simulate
+ expect(last_command_started.stdout).to include("mkfs.ext3 -q -z /tmp/undo-sdb1 /dev/sdb1")
+ end
it "creates ext4 filesystems correctly" do
use_fixture '0179-fs-basic.installfile'
run_simulate
expect(last_command_started.stdout).to include("mkfs.ext4 -q -z /tmp/undo-sdb1 /dev/sdb1")
end
+ it "creates JFS filesystems correctly" do
+ use_fixture '0195-fs-jfs.installfile'
+ run_simulate
+ expect(last_command_started.stdout).to include("mkfs.jfs -q /dev/sdb1")
+ end
+ it "creates VFAT filesystems correctly" do
+ use_fixture '0196-fs-vfat.installfile'
+ run_simulate
+ expect(last_command_started.stdout).to include("mkfs.vfat -F32 /dev/sdb1")
+ end
+ it "creates XFS filesystems correctly" do
+ use_fixture '0197-fs-xfs.installfile'
+ run_simulate
+ expect(last_command_started.stdout).to include("mkfs.xfs -f /dev/sdb1")
+ end
end
context "simulating 'mount' execution" do
it "mounts directories in tree order" do