summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0082-username-basic.installfile10
-rw-r--r--tests/fixtures/0083-username-duplicate.installfile7
-rw-r--r--tests/fixtures/0084-username-system.installfile6
-rw-r--r--tests/spec/validator.rb24
4 files changed, 47 insertions, 0 deletions
diff --git a/tests/fixtures/0082-username-basic.installfile b/tests/fixtures/0082-username-basic.installfile
new file mode 100644
index 0000000..9be8bd0
--- /dev/null
+++ b/tests/fixtures/0082-username-basic.installfile
@@ -0,0 +1,10 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+username chris
+username kayla
+username meg
+username steph
+username amanda
diff --git a/tests/fixtures/0083-username-duplicate.installfile b/tests/fixtures/0083-username-duplicate.installfile
new file mode 100644
index 0000000..0d85d91
--- /dev/null
+++ b/tests/fixtures/0083-username-duplicate.installfile
@@ -0,0 +1,7 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+username awilfox
+username awilfox
diff --git a/tests/fixtures/0084-username-system.installfile b/tests/fixtures/0084-username-system.installfile
new file mode 100644
index 0000000..467c408
--- /dev/null
+++ b/tests/fixtures/0084-username-system.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+username adm
diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb
index d54006d..16f397a 100644
--- a/tests/spec/validator.rb
+++ b/tests/spec/validator.rb
@@ -53,18 +53,21 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
use_fixture '0001-basic.installfile'
run_validate
expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
end
# HorizonScript Specification, ch 3.
it "handles comments" do
use_fixture '0002-basic-commented.installfile'
run_validate
expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
end
# HorizonScript Specification, ch 3.
it "handles blank lines and indentation" do
use_fixture '0003-basic-whitespace.installfile'
run_validate
expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
end
it "requires keys to have values" do
use_fixture '0015-keys-without-values.installfile'
@@ -505,12 +508,33 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do
expect(last_command_started).to have_output(/error: .*duplicate.*rootpw/)
end
end
+ context "user account keys:" do
+ context "'username'" do
+ it "succeeds with multiple usernames" do
+ use_fixture '0082-username-basic.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 duplicate usernames" do
+ use_fixture '0083-username-duplicate.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*duplicate.*username/)
+ end
+ it "fails with a system username" do
+ use_fixture '0084-username-system.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*username.*system/)
+ end
+ end
+ end
context "package specifications" do
# no requirements for these, but I think obvious.
it "works with all types of package atoms" do
use_fixture '0022-all-kinds-of-atoms.installfile'
run_validate
expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
end
it "does not accept invalid package atoms" do
use_fixture '0023-pkginstall-invalid-modifier.installfile'