summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-21 00:18:02 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-21 00:18:02 -0500
commit25750e7495e178fc22a07cd1d9dcfd34c7141036 (patch)
tree9c8765a825ec4a40b7caed0d3e3ddf15b631d183 /tests
parent64b7153ce0079f62331a2e66f45c4bbd0c703028 (diff)
downloadhorizon-25750e7495e178fc22a07cd1d9dcfd34c7141036.tar.gz
horizon-25750e7495e178fc22a07cd1d9dcfd34c7141036.tar.bz2
horizon-25750e7495e178fc22a07cd1d9dcfd34c7141036.tar.xz
horizon-25750e7495e178fc22a07cd1d9dcfd34c7141036.zip
hscript: Implement Language, add tests
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0115-language-simple.installfile6
-rw-r--r--tests/fixtures/0116-language-country.installfile6
-rw-r--r--tests/fixtures/0117-language-codeset.installfile6
-rw-r--r--tests/fixtures/0118-language-c-exception.installfile6
-rw-r--r--tests/fixtures/0119-language-invalid.installfile6
-rw-r--r--tests/fixtures/0120-language-iso.installfile6
-rw-r--r--tests/fixtures/0121-language-duplicate.installfile7
-rw-r--r--tests/spec/validator_spec.rb43
8 files changed, 86 insertions, 0 deletions
diff --git a/tests/fixtures/0115-language-simple.installfile b/tests/fixtures/0115-language-simple.installfile
new file mode 100644
index 0000000..ced3f0c
--- /dev/null
+++ b/tests/fixtures/0115-language-simple.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+language cy
diff --git a/tests/fixtures/0116-language-country.installfile b/tests/fixtures/0116-language-country.installfile
new file mode 100644
index 0000000..a6812a9
--- /dev/null
+++ b/tests/fixtures/0116-language-country.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+language ie_IE
diff --git a/tests/fixtures/0117-language-codeset.installfile b/tests/fixtures/0117-language-codeset.installfile
new file mode 100644
index 0000000..ae18d4a
--- /dev/null
+++ b/tests/fixtures/0117-language-codeset.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+language zh_TW.UTF-8
diff --git a/tests/fixtures/0118-language-c-exception.installfile b/tests/fixtures/0118-language-c-exception.installfile
new file mode 100644
index 0000000..4e2f53d
--- /dev/null
+++ b/tests/fixtures/0118-language-c-exception.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+language C.UTF-8
diff --git a/tests/fixtures/0119-language-invalid.installfile b/tests/fixtures/0119-language-invalid.installfile
new file mode 100644
index 0000000..209eacf
--- /dev/null
+++ b/tests/fixtures/0119-language-invalid.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+language klingon
diff --git a/tests/fixtures/0120-language-iso.installfile b/tests/fixtures/0120-language-iso.installfile
new file mode 100644
index 0000000..63f92e5
--- /dev/null
+++ b/tests/fixtures/0120-language-iso.installfile
@@ -0,0 +1,6 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+language en_US.ISO-8859-1
diff --git a/tests/fixtures/0121-language-duplicate.installfile b/tests/fixtures/0121-language-duplicate.installfile
new file mode 100644
index 0000000..83f7314
--- /dev/null
+++ b/tests/fixtures/0121-language-duplicate.installfile
@@ -0,0 +1,7 @@
+network false
+hostname test.machine
+pkginstall adelie-base
+rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/
+mount /dev/sda1 /
+language en
+language en
diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb
index 08f5886..3ed43ea 100644
--- a/tests/spec/validator_spec.rb
+++ b/tests/spec/validator_spec.rb
@@ -186,6 +186,44 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
expect(last_command_started).to have_output(/error: .*firmware.*value/)
end
end
+ context "for 'language' key" do
+ # Runner.Validate.language
+ # Runner.Validate.language.Format
+ it "supports a simple language" do
+ use_fixture '0115-language-simple.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "supports a language_territory value" do
+ use_fixture '0116-language-country.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "supports the UTF-8 codeset" do
+ use_fixture '0117-language-codeset.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "supports the special case C.UTF-8" do
+ use_fixture '0118-language-c-exception.installfile'
+ run_validate
+ expect(last_command_started).to have_output(PARSER_SUCCESS)
+ expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
+ end
+ it "requires a valid language" do
+ use_fixture '0119-language-invalid.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*language.*invalid/)
+ end
+ it "requires the UTF-8 codeset" do
+ use_fixture '0120-language-iso.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*language.*codeset/)
+ end
+ end
context "for 'mount' key" do
# Runner.Validate.mount.
it "fails with an invalid value" do
@@ -537,6 +575,11 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
skip "This build does not support firmware" if last_command_started.stdout !~ /supports non-free/
expect(last_command_started).to have_output(/error: .*duplicate.*firmware/)
end
+ it "fails with a duplicate 'language' key" do
+ use_fixture '0121-language-duplicate.installfile'
+ run_validate
+ expect(last_command_started).to have_output(/error: .*duplicate.*language/)
+ end
end
context "user account keys:" do
context "'username'" do