diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 17:23:00 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-19 17:23:00 -0500 |
commit | 55325a6e780b121f93d35076e4226521ca13ef12 (patch) | |
tree | b3cf5fa6131fa966e7427b8837311c8dcdc9ceaa /tests | |
parent | d3489c52d4ad1e5b17ce88e8b0e5142b30bb324e (diff) | |
download | horizon-55325a6e780b121f93d35076e4226521ca13ef12.tar.gz horizon-55325a6e780b121f93d35076e4226521ca13ef12.tar.bz2 horizon-55325a6e780b121f93d35076e4226521ca13ef12.tar.xz horizon-55325a6e780b121f93d35076e4226521ca13ef12.zip |
hscript: Implement UserIcon parsing
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixtures/0098-usericon-basic.installfile | 7 | ||||
-rw-r--r-- | tests/fixtures/0099-usericon-without-icon.installfile | 7 | ||||
-rw-r--r-- | tests/fixtures/0100-usericon-unknown-name.installfile | 8 | ||||
-rw-r--r-- | tests/fixtures/0101-usericon-duplicate.installfile | 8 | ||||
-rw-r--r-- | tests/fixtures/0102-usericon-protocols.installfile | 15 | ||||
-rw-r--r-- | tests/fixtures/0103-usericon-gopher.installfile | 7 | ||||
-rw-r--r-- | tests/spec/validator.rb | 39 |
7 files changed, 91 insertions, 0 deletions
diff --git a/tests/fixtures/0098-usericon-basic.installfile b/tests/fixtures/0098-usericon-basic.installfile new file mode 100644 index 0000000..8abb1a7 --- /dev/null +++ b/tests/fixtures/0098-usericon-basic.installfile @@ -0,0 +1,7 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +username awilfox +usericon awilfox /usr/share/user-manager/avatars/circles/Cat.png diff --git a/tests/fixtures/0099-usericon-without-icon.installfile b/tests/fixtures/0099-usericon-without-icon.installfile new file mode 100644 index 0000000..bdedf34 --- /dev/null +++ b/tests/fixtures/0099-usericon-without-icon.installfile @@ -0,0 +1,7 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +username awilfox +usericon awilfox diff --git a/tests/fixtures/0100-usericon-unknown-name.installfile b/tests/fixtures/0100-usericon-unknown-name.installfile new file mode 100644 index 0000000..047b8eb --- /dev/null +++ b/tests/fixtures/0100-usericon-unknown-name.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +username awilfox +# Intentional misspelling +usericon awilcox /usr/share/user-manager/avatars/circles/Cat.png diff --git a/tests/fixtures/0101-usericon-duplicate.installfile b/tests/fixtures/0101-usericon-duplicate.installfile new file mode 100644 index 0000000..b572891 --- /dev/null +++ b/tests/fixtures/0101-usericon-duplicate.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +username awilfox +usericon awilfox /usr/share/user-manager/avatars/circles/Cat.png +usericon awilfox /usr/share/user-manager/avatars/classic/TV.png diff --git a/tests/fixtures/0102-usericon-protocols.installfile b/tests/fixtures/0102-usericon-protocols.installfile new file mode 100644 index 0000000..246dc94 --- /dev/null +++ b/tests/fixtures/0102-usericon-protocols.installfile @@ -0,0 +1,15 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +username chris +usericon chris http://www.adelielinux.org/ +username kayla +usericon kayla HTTPS://www.adelielinux.org/ +username meg +usericon meg /usr/share/user-manager/avatars/circles/Cat.png +username steph +usericon steph tftp://192.168.1.1/avatar +username amanda +usericon amanda SmB://stuff:pw@10.4.1.1/c$/mypicture diff --git a/tests/fixtures/0103-usericon-gopher.installfile b/tests/fixtures/0103-usericon-gopher.installfile new file mode 100644 index 0000000..4a901b5 --- /dev/null +++ b/tests/fixtures/0103-usericon-gopher.installfile @@ -0,0 +1,7 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +username awilfox +usericon awilfox gopher://bbs.sick.bike/l/upload/b/13.jpe diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb index 76f1c6f..e43e5ed 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -612,6 +612,45 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(/warning: .*passphrase/) end end + context "'usericon'" do + # Runner.Validate.usericon. + it "succeeds with a valid icon/account pair" do + use_fixture '0098-usericon-basic.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + # Runner.Validate.usericon.Validity. + it "requires a path to be provided" do + use_fixture '0099-usericon-without-icon.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usericon.*required/) + end + # Runner.Validate.usericon.Name. + it "fails with a username that wasn't given" do + use_fixture '0100-usericon-unknown-name.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usericon.*name/) + end + # Runner.Validate.usericon.Unique. + it "fails with multiple icons associated with a single account" do + use_fixture '0101-usericon-duplicate.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*duplicate.*usericon/) + end + # Runner.Validate.usericon.ValidPath. + it "succeeds with all supported protocols" do + use_fixture '0102-usericon-protocols.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 unsupported protocol" do + use_fixture '0103-usericon-gopher.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*usericon.*URL/) + end + end end context "package specifications" do # no requirements for these, but I think obvious. |