summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-13 08:44:17 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-13 08:44:17 -0500
commit7757acdbcd0f6d7504136d46c3750c21f9ec3657 (patch)
treee6c91b601f553847b8c81a968ce062473705482e /tests
parent76e6c88c264cb81f5c5b716811161f1b5e96fc72 (diff)
downloadhorizon-7757acdbcd0f6d7504136d46c3750c21f9ec3657.tar.gz
horizon-7757acdbcd0f6d7504136d46c3750c21f9ec3657.tar.bz2
horizon-7757acdbcd0f6d7504136d46c3750c21f9ec3657.tar.xz
horizon-7757acdbcd0f6d7504136d46c3750c21f9ec3657.zip
tests: Test more invalid netaddress lines
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0058-netaddress-invalid-slaac.installfile6
-rw-r--r--tests/fixtures/0059-netaddress-invalid-address.installfile6
-rw-r--r--tests/spec/validator.rb12
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/fixtures/0058-netaddress-invalid-slaac.installfile b/tests/fixtures/0058-netaddress-invalid-slaac.installfile
new file mode 100644
index 0000000..7ae33f5
--- /dev/null
+++ b/tests/fixtures/0058-netaddress-invalid-slaac.installfile
@@ -0,0 +1,6 @@
+network true
+netaddress eth1 slaac 2600:1702:2a80:1b9f:5bbc:af4c:5dd1:a183 64
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
diff --git a/tests/fixtures/0059-netaddress-invalid-address.installfile b/tests/fixtures/0059-netaddress-invalid-address.installfile
new file mode 100644
index 0000000..119b25a
--- /dev/null
+++ b/tests/fixtures/0059-netaddress-invalid-address.installfile
@@ -0,0 +1,6 @@
+network true
+netaddress eth0 static ujqjerf9wur 255.255.0.0
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb
index 7dfe752..e618638 100644
--- a/tests/spec/validator.rb
+++ b/tests/spec/validator.rb
@@ -240,6 +240,12 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*netaddress.*dhcp/)
end
+ # Runner.Validate.netaddress.Validity.DHCP.
+ it "fails on extraneous elements in SLAAC mode" do
+ use_fixture '0058-netaddress-invalid-slaac.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*netaddress.*slaac/)
+ end
# Runner.Validate.netaddress.Validity.Static.
it "fails on extraneous elements in static mode" do
use_fixture '0039-netaddress-static-too-many.installfile'
@@ -278,6 +284,12 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*netaddress.*address/)
end
+ # Runner.Validate.netaddress.Validity.Address.
+ it "fails with invalid address" do
+ use_fixture '0059-netaddress-invalid-address.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*netaddress.*address/)
+ end
# Runner.Validate.netaddress.Validity.Mask.
it "fails with invalid IPv4 prefix length" do
use_fixture '0045-netaddress-invalid-prefix4.installfile'