summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-29 10:51:41 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-29 10:51:41 -0500
commit7fbaf52dbd9a9afb406d4a631ff5a1625c90ef64 (patch)
tree007870da7872a8828d4bc4babfc49f9e01557992 /tests
parent84b7e98b805b86e4d63e2ce38a490e86541ed0da (diff)
downloadhorizon-7fbaf52dbd9a9afb406d4a631ff5a1625c90ef64.tar.gz
horizon-7fbaf52dbd9a9afb406d4a631ff5a1625c90ef64.tar.bz2
horizon-7fbaf52dbd9a9afb406d4a631ff5a1625c90ef64.tar.xz
horizon-7fbaf52dbd9a9afb406d4a631ff5a1625c90ef64.zip
hscript: Implement lvm_vg, add tests
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0166-lvmvg-basic.installfile11
-rw-r--r--tests/fixtures/0167-lvmvg-invalid.installfile11
-rw-r--r--tests/fixtures/0168-lvmvg-duplicate.installfile12
-rw-r--r--tests/fixtures/0169-lvmvg-dash.installfile11
-rw-r--r--tests/fixtures/0170-lvmvg-without-vg.installfile11
-rw-r--r--tests/spec/validator_spec.rb28
6 files changed, 84 insertions, 0 deletions
diff --git a/tests/fixtures/0166-lvmvg-basic.installfile b/tests/fixtures/0166-lvmvg-basic.installfile
new file mode 100644
index 0000000..8d970bc
--- /dev/null
+++ b/tests/fixtures/0166-lvmvg-basic.installfile
@@ -0,0 +1,11 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+diskid /dev/sdb WDC
+disklabel /dev/sdb apm
+partition /dev/sdb 1 8M boot
+partition /dev/sdb 2 fill
+lvm_pv /dev/sdb2
+lvm_vg /dev/sdb2 MyVolGroup
diff --git a/tests/fixtures/0167-lvmvg-invalid.installfile b/tests/fixtures/0167-lvmvg-invalid.installfile
new file mode 100644
index 0000000..e139e41
--- /dev/null
+++ b/tests/fixtures/0167-lvmvg-invalid.installfile
@@ -0,0 +1,11 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+diskid /dev/sdb WDC
+disklabel /dev/sdb apm
+partition /dev/sdb 1 8M boot
+partition /dev/sdb 2 fill
+lvm_pv /dev/sdb2
+lvm_vg sdb2 MyVolGroup
diff --git a/tests/fixtures/0168-lvmvg-duplicate.installfile b/tests/fixtures/0168-lvmvg-duplicate.installfile
new file mode 100644
index 0000000..2a6bfd0
--- /dev/null
+++ b/tests/fixtures/0168-lvmvg-duplicate.installfile
@@ -0,0 +1,12 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+diskid /dev/sdb WDC
+disklabel /dev/sdb apm
+partition /dev/sdb 1 8M boot
+partition /dev/sdb 2 fill
+lvm_pv /dev/sdb2
+lvm_vg /dev/sdb2 MyVolGroup
+lvm_vg /dev/sdb2 MyVolGroup
diff --git a/tests/fixtures/0169-lvmvg-dash.installfile b/tests/fixtures/0169-lvmvg-dash.installfile
new file mode 100644
index 0000000..057a49c
--- /dev/null
+++ b/tests/fixtures/0169-lvmvg-dash.installfile
@@ -0,0 +1,11 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+diskid /dev/sdb WDC
+disklabel /dev/sdb apm
+partition /dev/sdb 1 8M boot
+partition /dev/sdb 2 fill
+lvm_pv /dev/sdb2
+lvm_vg /dev/sdb2 -MyVolGroup
diff --git a/tests/fixtures/0170-lvmvg-without-vg.installfile b/tests/fixtures/0170-lvmvg-without-vg.installfile
new file mode 100644
index 0000000..2cf015e
--- /dev/null
+++ b/tests/fixtures/0170-lvmvg-without-vg.installfile
@@ -0,0 +1,11 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+diskid /dev/sdb WDC
+disklabel /dev/sdb apm
+partition /dev/sdb 1 8M boot
+partition /dev/sdb 2 fill
+lvm_pv /dev/sdb2
+lvm_vg /dev/sdb2
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index 976f0f6..0443140 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -806,6 +806,34 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
expect(last_command_started).to have_output(/error: .*lvm_pv.*exists/)
end
end
+ context "for 'lvm_vg' key" do
+ it "succeeds with a normal value" do
+ use_fixture '0166-lvmvg-basic.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "fails with an invalid PV path" do
+ use_fixture '0167-lvmvg-invalid.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_vg.*path/)
+ end
+ it "fails with a duplicate volume group name" do
+ use_fixture '0168-lvmvg-duplicate.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_vg.*exists/)
+ end
+ it "fails with a dash as the first character of the VG name" do
+ use_fixture '0169-lvmvg-dash.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_vg.*name/)
+ end
+ it "requires a volume group name" do
+ use_fixture '0170-lvmvg-without-vg.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*lvm_vg.*expected/)
+ end
+ end
end
context "unique keys" do
# Runner.Validate.network.