summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-07-04 08:56:03 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-07-04 08:56:03 -0500
commit1d9c703a8eebcf8f328e610879c7a1799258bba3 (patch)
tree5c1a84c61e4277e931effe8c2aea25b20932936a /tests
parentb0690189d37cb96924fd52e6647f84020ba56ef6 (diff)
downloadhorizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.tar.gz
horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.tar.bz2
horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.tar.xz
horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.zip
hscipt: Implement parse and validation of 'pppoe' key
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0241-pppoe-basic.installfile6
-rw-r--r--tests/fixtures/0242-pppoe-auth.installfile6
-rw-r--r--tests/fixtures/0243-pppoe-allkeys.installfile6
-rw-r--r--tests/fixtures/0244-pppoe-invalid.installfile6
-rw-r--r--tests/fixtures/0245-pppoe-valueless.installfile6
-rw-r--r--tests/spec/validator_spec.rb35
6 files changed, 63 insertions, 2 deletions
diff --git a/tests/fixtures/0241-pppoe-basic.installfile b/tests/fixtures/0241-pppoe-basic.installfile
new file mode 100644
index 0000000..9e7d4e5
--- /dev/null
+++ b/tests/fixtures/0241-pppoe-basic.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+pppoe eth0
diff --git a/tests/fixtures/0242-pppoe-auth.installfile b/tests/fixtures/0242-pppoe-auth.installfile
new file mode 100644
index 0000000..250e820
--- /dev/null
+++ b/tests/fixtures/0242-pppoe-auth.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+pppoe eth0 username=awilfox password=fuzzball
diff --git a/tests/fixtures/0243-pppoe-allkeys.installfile b/tests/fixtures/0243-pppoe-allkeys.installfile
new file mode 100644
index 0000000..6b70daa
--- /dev/null
+++ b/tests/fixtures/0243-pppoe-allkeys.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+pppoe eth0 username=awilfox password=fuzzball mtu=9001 lcp-echo-interval=10 lcp-echo-failure=5
diff --git a/tests/fixtures/0244-pppoe-invalid.installfile b/tests/fixtures/0244-pppoe-invalid.installfile
new file mode 100644
index 0000000..8fc2768
--- /dev/null
+++ b/tests/fixtures/0244-pppoe-invalid.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+pppoe eth0 cat=meow
diff --git a/tests/fixtures/0245-pppoe-valueless.installfile b/tests/fixtures/0245-pppoe-valueless.installfile
new file mode 100644
index 0000000..ee75450
--- /dev/null
+++ b/tests/fixtures/0245-pppoe-valueless.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+pppoe eth0 username password=fuzzball
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index 8fb6c95..d2d121a 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -278,6 +278,37 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
expect(last_command_started).to have_output(/error: .*nameserver.*valid IPv6/)
end
end
+ context "for 'pppoe' key" do
+ it "succeeds with only an interface" do
+ use_fixture '0241-pppoe-basic.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 autnentication credentials" do
+ use_fixture '0242-pppoe-auth.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 all valid keys" do
+ use_fixture '0243-pppoe-allkeys.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 key" do
+ use_fixture '0244-pppoe-invalid.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*pppoe.*invalid/)
+ end
+ it "succeeds with a value-less key" do
+ use_fixture '0245-pppoe-valueless.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ end
context "for 'firmware' key" do
it "always supports 'false' value" do
use_fixture '0112-firmware-false.installfile'
@@ -687,12 +718,12 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
run_validate
expect(last_command_started).to have_output(/error: .*svcenable.*invalid/)
end
- it "succeeds with a runlevel specified" do
+ it "succeeds with a runlevel specified" do
use_fixture '0239-svcenable-runlevel.installfile'
run_validate
expect(last_command_started).to have_output(PARSER_SUCCESS)
expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
- end
+ end
end
context "for 'diskid' key" do
it "succeeds with basic disk identification" do