summaryrefslogtreecommitdiff
path: root/tests
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
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')
-rw-r--r--tests/fixtures/0193-fs-ext2.installfile9
-rw-r--r--tests/fixtures/0194-fs-ext3.installfile9
-rw-r--r--tests/fixtures/0195-fs-jfs.installfile9
-rw-r--r--tests/fixtures/0196-fs-vfat.installfile9
-rw-r--r--tests/fixtures/0197-fs-xfs.installfile9
-rw-r--r--tests/spec/simulator_spec.rb42
6 files changed, 87 insertions, 0 deletions
diff --git a/tests/fixtures/0193-fs-ext2.installfile b/tests/fixtures/0193-fs-ext2.installfile
new file mode 100644
index 0000000..a0b6c9d
--- /dev/null
+++ b/tests/fixtures/0193-fs-ext2.installfile
@@ -0,0 +1,9 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+diskid /dev/sdb WDBNCE2500PNC
+disklabel /dev/sdb gpt
+partition /dev/sdb 1 fill
+fs /dev/sdb1 ext2
+mount /dev/sdb1 /
diff --git a/tests/fixtures/0194-fs-ext3.installfile b/tests/fixtures/0194-fs-ext3.installfile
new file mode 100644
index 0000000..b261530
--- /dev/null
+++ b/tests/fixtures/0194-fs-ext3.installfile
@@ -0,0 +1,9 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+diskid /dev/sdb WDBNCE2500PNC
+disklabel /dev/sdb mbr
+partition /dev/sdb 1 fill
+fs /dev/sdb1 ext3
+mount /dev/sdb1 /
diff --git a/tests/fixtures/0195-fs-jfs.installfile b/tests/fixtures/0195-fs-jfs.installfile
new file mode 100644
index 0000000..40bc217
--- /dev/null
+++ b/tests/fixtures/0195-fs-jfs.installfile
@@ -0,0 +1,9 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+diskid /dev/sdb WDBNCE2500PNC
+disklabel /dev/sdb apm
+partition /dev/sdb 1 fill
+fs /dev/sdb1 jfs
+mount /dev/sdb1 /
diff --git a/tests/fixtures/0196-fs-vfat.installfile b/tests/fixtures/0196-fs-vfat.installfile
new file mode 100644
index 0000000..bea20f9
--- /dev/null
+++ b/tests/fixtures/0196-fs-vfat.installfile
@@ -0,0 +1,9 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+diskid /dev/sdb WDBNCE2500PNC
+disklabel /dev/sdb gpt
+partition /dev/sdb 1 fill
+fs /dev/sdb1 vfat
+mount /dev/sdb1 /
diff --git a/tests/fixtures/0197-fs-xfs.installfile b/tests/fixtures/0197-fs-xfs.installfile
new file mode 100644
index 0000000..488fdf6
--- /dev/null
+++ b/tests/fixtures/0197-fs-xfs.installfile
@@ -0,0 +1,9 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+diskid /dev/sdb WDBNCE2500PNC
+disklabel /dev/sdb apm
+partition /dev/sdb 1 fill
+fs /dev/sdb1 xfs
+mount /dev/sdb1 /
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