summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-12 01:50:07 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-12 01:50:07 -0500
commit74394f7f981fb299f38d8a2cb9f52079d383dd6e (patch)
tree7ed5c546e1b5ab0b37d7d2a0930cf2664e445eff
parent1f0a1dec1af315e6465e1c1dd503aa942a85b1f4 (diff)
downloadhorizon-74394f7f981fb299f38d8a2cb9f52079d383dd6e.tar.gz
horizon-74394f7f981fb299f38d8a2cb9f52079d383dd6e.tar.bz2
horizon-74394f7f981fb299f38d8a2cb9f52079d383dd6e.tar.xz
horizon-74394f7f981fb299f38d8a2cb9f52079d383dd6e.zip
tests: Fix up some mount tests
-rw-r--r--tests/fixtures/0031-mount-nonroot.installfile5
-rw-r--r--tests/spec/validator.rb80
2 files changed, 49 insertions, 36 deletions
diff --git a/tests/fixtures/0031-mount-nonroot.installfile b/tests/fixtures/0031-mount-nonroot.installfile
new file mode 100644
index 0000000..bc86e9f
--- /dev/null
+++ b/tests/fixtures/0031-mount-nonroot.installfile
@@ -0,0 +1,5 @@
+network true
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /usr
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb
index b1cd2ab..8f6ae6c 100644
--- a/tests/spec/validator.rb
+++ b/tests/spec/validator.rb
@@ -113,7 +113,7 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
expect(last_command_started).to have_output(/error: .*network.*/)
end
# Runner.Validate.hostname.
- context "fails with an invalid 'hostname' value" do
+ context "for 'hostname' key" do
# Runner.Validate.hostname.Chars.
it "with invalid characters" do
use_fixture '0012-invalid-hostname.installfile'
@@ -146,41 +146,49 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*rootpw.*/)
end
- # Runner.Validate.mount.
- it "fails with an invalid 'mount' value" do
- use_fixture '0014-invalid-mount.installfile'
- run_validate
- expect(last_command_started).to have_output(/error: .*mount.*/)
- end
- # Runner.Validate.mount.
- it "fails with too many values in 'mount' tuple" do
- use_fixture '0029-mount-too-many.installfile'
- run_validate
- expect(last_command_started).to have_output(/error: .*mount.*elements/)
- end
- # Runner.Validate.mount.
- it "fails with too few values in 'mount' tuple" do
- use_fixture '0030-mount-too-few.installfile'
- run_validate
- expect(last_command_started).to have_output(/error: .*mount.*elements/)
- end
- # Runner.Validate.mount.Block.
- it "fails with a 'mount' value that has no block device" do
- use_fixture '0027-mount-invalid-dev.installfile'
- run_validate
- expect(last_command_started).to have_output(/error: .*mount.*device/)
- end
- # Runner.Validate.mount.Point.
- it "fails with a 'mount' value that has an invalid mountpoint" do
- use_fixture '0028-mount-non-absolute.installfile'
- run_validate
- expect(last_command_started).to have_output(/error: .*mount.*path/)
- end
- # Runner.Validate.mount.Unique.
- it "fails with two root 'mount' keys" do
- use_fixture '0021-duplicate-root-mount.installfile'
- run_validate
- expect(last_command_started).to have_output(/error: .*mount.*duplicate/)
+ context "for 'mount' key" do
+ # Runner.Validate.mount.
+ it "fails with an invalid value" do
+ use_fixture '0014-invalid-mount.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*mount.*/)
+ end
+ # Runner.Validate.mount.Validity.
+ it "fails with too many values in 'mount' tuple" do
+ use_fixture '0029-mount-too-many.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*mount.*elements/)
+ end
+ # Runner.Validate.mount.Validity.
+ it "fails with too few values in 'mount' tuple" do
+ use_fixture '0030-mount-too-few.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*mount.*elements/)
+ end
+ # Runner.Validate.mount.Block.
+ it "fails with a 'mount' value that has no block device" do
+ use_fixture '0027-mount-invalid-dev.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*mount.*device/)
+ end
+ # Runner.Validate.mount.Point.
+ it "fails with a 'mount' value that has an invalid mountpoint" do
+ use_fixture '0028-mount-non-absolute.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*mount.*path/)
+ end
+ # Runner.Validate.mount.Unique.
+ it "fails with two root 'mount' keys" do
+ use_fixture '0021-duplicate-root-mount.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*mount.*duplicate/)
+ end
+ # Runner.Validate.mount.Root.
+ it "fails without a root 'mount' key" do
+ use_fixture '0031-mount-nonroot.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*mount.*root/)
+ end
end
end
context "unique keys" do