diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-12 02:35:20 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-12 02:35:20 -0500 |
commit | 717ace2e5f9f7c19c00fca5732c13d38d97e342d (patch) | |
tree | 1eb79f3cc455a9997cde27917feb09a60a95450c | |
parent | c9ac06657ecf79c5c7bada112a6fc67f87fbcba1 (diff) | |
download | horizon-717ace2e5f9f7c19c00fca5732c13d38d97e342d.tar.gz horizon-717ace2e5f9f7c19c00fca5732c13d38d97e342d.tar.bz2 horizon-717ace2e5f9f7c19c00fca5732c13d38d97e342d.tar.xz horizon-717ace2e5f9f7c19c00fca5732c13d38d97e342d.zip |
tests: Add 'netaddress' keys, will be next key implemented
24 files changed, 601 insertions, 6 deletions
diff --git a/tests/fixtures/0001-basic.installfile b/tests/fixtures/0001-basic.installfile index a87b8f1..fb1d0fb 100644 --- a/tests/fixtures/0001-basic.installfile +++ b/tests/fixtures/0001-basic.installfile @@ -1,4 +1,4 @@ -network true +network false hostname test.machine pkginstall adelie-base rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ diff --git a/tests/fixtures/0033-network-without-netaddress.installfile b/tests/fixtures/0033-network-without-netaddress.installfile new file mode 100644 index 0000000..a87b8f1 --- /dev/null +++ b/tests/fixtures/0033-network-without-netaddress.installfile @@ -0,0 +1,5 @@ +network true +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0034-nonetwork-with-netaddress.installfile b/tests/fixtures/0034-nonetwork-with-netaddress.installfile new file mode 100644 index 0000000..45f29f4 --- /dev/null +++ b/tests/fixtures/0034-nonetwork-with-netaddress.installfile @@ -0,0 +1,6 @@ +network false +netaddress eth0 dhcp +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0035-network-with-netaddress.installfile b/tests/fixtures/0035-network-with-netaddress.installfile new file mode 100644 index 0000000..b2ade75 --- /dev/null +++ b/tests/fixtures/0035-network-with-netaddress.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 dhcp +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0036-netaddress-too-few.installfile b/tests/fixtures/0036-netaddress-too-few.installfile new file mode 100644 index 0000000..4ced0f0 --- /dev/null +++ b/tests/fixtures/0036-netaddress-too-few.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth1 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0037-netaddress-invalid-type.installfile b/tests/fixtures/0037-netaddress-invalid-type.installfile new file mode 100644 index 0000000..552a91f --- /dev/null +++ b/tests/fixtures/0037-netaddress-invalid-type.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth1 ip4ll +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0038-netaddress-invalid-dhcp.installfile b/tests/fixtures/0038-netaddress-invalid-dhcp.installfile new file mode 100644 index 0000000..df2a41b --- /dev/null +++ b/tests/fixtures/0038-netaddress-invalid-dhcp.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth1 dhcp 127.0.0.1 255.0.0.0 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0039-netaddress-static-too-many.installfile b/tests/fixtures/0039-netaddress-static-too-many.installfile new file mode 100644 index 0000000..9e34571 --- /dev/null +++ b/tests/fixtures/0039-netaddress-static-too-many.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth1 static 127.0.0.1 255.0.0.0 127.0.0.2 255.0.0.0 127.0.0.3 255.0.0.0 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0040-netaddress-static-too-few.installfile b/tests/fixtures/0040-netaddress-static-too-few.installfile new file mode 100644 index 0000000..7dabeff --- /dev/null +++ b/tests/fixtures/0040-netaddress-static-too-few.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth1 static 127.0.0.1 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0041-netaddress-valid-static4.installfile b/tests/fixtures/0041-netaddress-valid-static4.installfile new file mode 100644 index 0000000..aaaf70d --- /dev/null +++ b/tests/fixtures/0041-netaddress-valid-static4.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static 172.16.1.11 255.255.0.0 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0042-netaddress-valid-static6.installfile b/tests/fixtures/0042-netaddress-valid-static6.installfile new file mode 100644 index 0000000..1941598 --- /dev/null +++ b/tests/fixtures/0042-netaddress-valid-static6.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static 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/0043-netaddress-invalid-static4.installfile b/tests/fixtures/0043-netaddress-invalid-static4.installfile new file mode 100644 index 0000000..09afa76 --- /dev/null +++ b/tests/fixtures/0043-netaddress-invalid-static4.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static 345.678.901.234 255.255.0.0 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0044-netaddress-invalid-static6.installfile b/tests/fixtures/0044-netaddress-invalid-static6.installfile new file mode 100644 index 0000000..7d96ef0 --- /dev/null +++ b/tests/fixtures/0044-netaddress-invalid-static6.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static fe1: 64 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0045-netaddress-invalid-prefix4.installfile b/tests/fixtures/0045-netaddress-invalid-prefix4.installfile new file mode 100644 index 0000000..3741334 --- /dev/null +++ b/tests/fixtures/0045-netaddress-invalid-prefix4.installfile @@ -0,0 +1,7 @@ +network true +# 61 as a typo for 16 +netaddress eth0 172.16.1.11 61 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0046-netaddress-invalid-prefix6.installfile b/tests/fixtures/0046-netaddress-invalid-prefix6.installfile new file mode 100644 index 0000000..1ce13e9 --- /dev/null +++ b/tests/fixtures/0046-netaddress-invalid-prefix6.installfile @@ -0,0 +1,7 @@ +network true +# 210 as a typo for 120 +netaddress eth0 static 2600:1702:2a80:1b9f:5bbc:af4c:5dd1:a183 210 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0047-netaddress-invalid-mask.installfile b/tests/fixtures/0047-netaddress-invalid-mask.installfile new file mode 100644 index 0000000..ef89553 --- /dev/null +++ b/tests/fixtures/0047-netaddress-invalid-mask.installfile @@ -0,0 +1,7 @@ +network true +# 525 as a typo for 255 +netaddress eth0 static 172.161.1.11 255.255.255.525 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0048-netaddress-gateway4.installfile b/tests/fixtures/0048-netaddress-gateway4.installfile new file mode 100644 index 0000000..84ef23a --- /dev/null +++ b/tests/fixtures/0048-netaddress-gateway4.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static 172.16.1.11 16 172.16.1.1 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0049-netaddress-gateway6.installfile b/tests/fixtures/0049-netaddress-gateway6.installfile new file mode 100644 index 0000000..e38b156 --- /dev/null +++ b/tests/fixtures/0049-netaddress-gateway6.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static 2600:1702:2a80:1b9f:5bbc:af4c:5dd1:a183 64 fe80::26f5:a2ff:fec1:7829 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0050-netaddress-bad-gateway4.installfile b/tests/fixtures/0050-netaddress-bad-gateway4.installfile new file mode 100644 index 0000000..ef9f250 --- /dev/null +++ b/tests/fixtures/0050-netaddress-bad-gateway4.installfile @@ -0,0 +1,7 @@ +network true +# 271 as a typo for 172 +netaddress eth0 static 172.16.1.11 16 271.16.1.11 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0051-netaddress-bad-gateway6.installfile b/tests/fixtures/0051-netaddress-bad-gateway6.installfile new file mode 100644 index 0000000..720e7cd --- /dev/null +++ b/tests/fixtures/0051-netaddress-bad-gateway6.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static 2600:1702:2a80:1b9f:5bbc:af4c:5dd1:a183 64 fe1: +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0052-netaddress-bad-gateway46.installfile b/tests/fixtures/0052-netaddress-bad-gateway46.installfile new file mode 100644 index 0000000..84f5199 --- /dev/null +++ b/tests/fixtures/0052-netaddress-bad-gateway46.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static 172.16.1.11 16 fe80::26f5:a2ff:fec1:7829 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0053-netaddress-bad-gateway64.installfile b/tests/fixtures/0053-netaddress-bad-gateway64.installfile new file mode 100644 index 0000000..cb14fde --- /dev/null +++ b/tests/fixtures/0053-netaddress-bad-gateway64.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static 2600:1702:2a80:1b9f:5bbc:af4c:5dd1:a183 64 172.16.1.1 +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/fixtures/0054-huge-netaddress.installfile b/tests/fixtures/0054-huge-netaddress.installfile new file mode 100644 index 0000000..4246d00 --- /dev/null +++ b/tests/fixtures/0054-huge-netaddress.installfile @@ -0,0 +1,325 @@ +network true +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +netaddress eth0 dhcp +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 e4ba703..44e9863 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -11,6 +11,7 @@ def use_fixture(fixture) end PARSER_SUCCESS = /parser: 0 error\(s\), 0 warning\(s\)/ +VALIDATOR_SUCCESS = /validator: 0 failure\(s\)/ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do context "argument passing" do @@ -106,11 +107,13 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do end end context "values" do - # Runner.Validate.network. - it "fails with an invalid 'network' value" do - use_fixture '0011-invalid-network.installfile' - run_validate - expect(last_command_started).to have_output(/error: .*network.*/) + context "for 'network' key" do + # Runner.Validate.network. + it "fails with an invalid 'network' value" do + use_fixture '0011-invalid-network.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*network.*/) + end end # Runner.Validate.hostname. context "for 'hostname' key" do @@ -196,6 +199,144 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do expect(last_command_started).to have_output(/error: .*mount.*root/) end end + context "for 'netaddress' key" do + # Runner.Validate.network. / Runner.Validate.netaddress. + it "requires 'netaddress' when 'network' is true" do + use_fixture '0033-network-without-netaddress.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + it "allows 'netaddress' when 'network' is false" do + use_fixture '0034-nonetwork-with-netaddress.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "succeeds with simple 'netaddress' (DHCP on eth0)" do + use_fixture '0035-network-with-netaddress.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + # Runner.Validate.netaddress.Validity. + it "requires 'netaddress' to have at least two elements" do + use_fixture '0036-netaddress-too-few.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Type. + it "fails on invalid address type" do + use_fixture '0037-netaddress-invalid-type.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.DHCP. + it "fails on extraneous elements in DHCP mode" do + use_fixture '0038-netaddress-invalid-dhcp.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Static. + it "fails on extraneous elements in static mode" do + use_fixture '0039-netaddress-static-too-many.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Static. + it "fails on too few elements in static mode" do + use_fixture '0040-netaddress-static-too-few.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Address. + it "succeeds with valid IPv4 address specification" do + use_fixture '0041-netaddress-valid-static4.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + # Runner.Validate.netaddress.Validity.Address. + it "succeeds with valid IPv6 address specification" do + use_fixture '0042-netaddress-valid-static6.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + # Runner.Validate.netaddress.Validity.Address. + it "fails with invalid IPv4 address specification" do + use_fixture '0043-netaddress-invalid-static4.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Address. + it "fails with invalid IPv6 address specification" do + use_fixture '0044-netaddress-invalid-static6.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Mask. + it "fails with invalid IPv4 prefix length" do + use_fixture '0045-netaddress-invalid-prefix4.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Mask. + it "fails with invalid IPv6 prefix length" do + use_fixture '0046-netaddress-invalid-prefix6.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Mask. + it "fails with invalid IPv4 network mask" do + use_fixture '0047-netaddress-invalid-mask.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Gateway. + it "succeeds with valid IPv4 gateway" do + use_fixture '0048-netaddress-gateway4.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + # Runner.Validate.netaddress.Validity.Gateway. + it "succeeds with valid IPv6 gateway" do + use_fixture '0049-netaddress-gateway6.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + # Runner.Validate.netaddress.Validity.Gateway. + it "fails with invalid IPv4 gateway" do + use_fixture '0050-netaddress-bad-gateway4.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Gateway. + it "fails with invalid IPv6 gateway" do + use_fixture '0051-netaddress-bad-gateway6.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Gateway. + it "fails with mismatched IPv4/v6 gateway" do + use_fixture '0052-netaddress-bad-gateway46.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Gateway. + it "fails with mismatched IPv6/v4 gateway" do + use_fixture '0053-netaddress-bad-gateway64.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + # Runner.Validate.netaddress.Validity.Count. + it "fails with too many addresses" do + use_fixture '0054-huge-netaddress.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*netaddress.*/) + end + end end context "unique keys" do # Runner.Validate.network. |