diff options
4 files changed, 27 insertions, 1 deletions
diff --git a/tests/fixtures/0045-netaddress-invalid-prefix4.installfile b/tests/fixtures/0045-netaddress-invalid-prefix4.installfile index 3741334..3226a4b 100644 --- a/tests/fixtures/0045-netaddress-invalid-prefix4.installfile +++ b/tests/fixtures/0045-netaddress-invalid-prefix4.installfile @@ -1,6 +1,6 @@ network true # 61 as a typo for 16 -netaddress eth0 172.16.1.11 61 +netaddress eth0 static 172.16.1.11 61 hostname test.machine pkginstall adelie-base rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ diff --git a/tests/fixtures/0060-netaddress-invalid-prefix4.installfile b/tests/fixtures/0060-netaddress-invalid-prefix4.installfile new file mode 100644 index 0000000..5714e06 --- /dev/null +++ b/tests/fixtures/0060-netaddress-invalid-prefix4.installfile @@ -0,0 +1,7 @@ +network true +# qy as typo for 16 (qwerty key row) +netaddress eth0 static 172.16.1.11 qy +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0061-netaddress-invalid-prefix6.installfile b/tests/fixtures/0061-netaddress-invalid-prefix6.installfile new file mode 100644 index 0000000..ac9f4d0 --- /dev/null +++ b/tests/fixtures/0061-netaddress-invalid-prefix6.installfile @@ -0,0 +1,7 @@ +network true +# yr as a typo for 64 (qwerty keyboard row) +netaddress eth0 static 2600:1702:2a80:1b9f:5bbc:af4c:5dd1:a183 yr +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 e618638..96cf572 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -303,6 +303,18 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do expect(last_command_started).to have_output(/error: .*netaddress.*prefix/) end # Runner.Validate.netaddress.Validity.Mask. + it "fails with non-numeric IPv4 prefix length" do + use_fixture '0060-netaddress-invalid-prefix4.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*prefix/) + end + # Runner.Validate.netaddress.Validity.Mask. + it "fails with non-numeric IPv6 prefix length" do + use_fixture '0061-netaddress-invalid-prefix6.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*prefix/) + end + # Runner.Validate.netaddress.Validity.Mask. it "fails with invalid IPv4 network mask" do use_fixture '0047-netaddress-invalid-mask.installfile' run_validate |