diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixtures/0058-netaddress-invalid-slaac.installfile | 6 | ||||
-rw-r--r-- | tests/fixtures/0059-netaddress-invalid-address.installfile | 6 | ||||
-rw-r--r-- | tests/spec/validator.rb | 12 |
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' |