diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixtures/0055-repository-basic.installfile | 7 | ||||
-rw-r--r-- | tests/fixtures/0056-repository-invalid.installfile | 6 | ||||
-rw-r--r-- | tests/spec/validator.rb | 13 |
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/fixtures/0055-repository-basic.installfile b/tests/fixtures/0055-repository-basic.installfile new file mode 100644 index 0000000..b7d8d7f --- /dev/null +++ b/tests/fixtures/0055-repository-basic.installfile @@ -0,0 +1,7 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +repository https://distfiles.adelielinux.org/adelie/current/system +repository https://distfiles.adelielinux.org/adelie/current/user diff --git a/tests/fixtures/0056-repository-invalid.installfile b/tests/fixtures/0056-repository-invalid.installfile new file mode 100644 index 0000000..0b393a5 --- /dev/null +++ b/tests/fixtures/0056-repository-invalid.installfile @@ -0,0 +1,6 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / +repository ftp://anonymous:password@unsupported.ftp.network/pub/adelie/current/system diff --git a/tests/spec/validator.rb b/tests/spec/validator.rb index 4ba83cf..11fd4c4 100644 --- a/tests/spec/validator.rb +++ b/tests/spec/validator.rb @@ -337,6 +337,19 @@ RSpec.describe 'HorizonScript Validation Utility', :type => :aruba do expect(last_command_started).to have_output(/error: .*netaddress.*addresses/) end end + context "for 'repository' key" do + it "succeeds with basic repositories" do + use_fixture '0055-repository-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 invalid repository URL" do + use_fixture '0056-repository-invalid.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*repository/) + end + end end context "unique keys" do # Runner.Validate.network. |