diff options
Diffstat (limited to 'tests')
29 files changed, 384 insertions, 0 deletions
diff --git a/tests/fixtures/0135-partition-basic.installfile b/tests/fixtures/0135-partition-basic.installfile new file mode 100644 index 0000000..3e01567 --- /dev/null +++ b/tests/fixtures/0135-partition-basic.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 fill +mount /dev/sdb1 / diff --git a/tests/fixtures/0136-partition-size-bytes.installfile b/tests/fixtures/0136-partition-size-bytes.installfile new file mode 100644 index 0000000..07caa90 --- /dev/null +++ b/tests/fixtures/0136-partition-size-bytes.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 1048576 +mount /dev/sdb1 / diff --git a/tests/fixtures/0137-partition-size-kbytes.installfile b/tests/fixtures/0137-partition-size-kbytes.installfile new file mode 100644 index 0000000..45a82e2 --- /dev/null +++ b/tests/fixtures/0137-partition-size-kbytes.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 1048576K +mount /dev/sdb1 / diff --git a/tests/fixtures/0138-partition-size-mbytes.installfile b/tests/fixtures/0138-partition-size-mbytes.installfile new file mode 100644 index 0000000..c6dfc79 --- /dev/null +++ b/tests/fixtures/0138-partition-size-mbytes.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 1024M +mount /dev/sdb1 / diff --git a/tests/fixtures/0139-partition-size-gbytes.installfile b/tests/fixtures/0139-partition-size-gbytes.installfile new file mode 100644 index 0000000..4921abf --- /dev/null +++ b/tests/fixtures/0139-partition-size-gbytes.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 20G +mount /dev/sdb1 / diff --git a/tests/fixtures/0140-partition-size-tbytes.installfile b/tests/fixtures/0140-partition-size-tbytes.installfile new file mode 100644 index 0000000..04769eb --- /dev/null +++ b/tests/fixtures/0140-partition-size-tbytes.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 1T +mount /dev/sdb1 / diff --git a/tests/fixtures/0141-partition-size-ebytes.installfile b/tests/fixtures/0141-partition-size-ebytes.installfile new file mode 100644 index 0000000..5d41250 --- /dev/null +++ b/tests/fixtures/0141-partition-size-ebytes.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 2E +mount /dev/sdb1 / diff --git a/tests/fixtures/0142-partition-size-percent.installfile b/tests/fixtures/0142-partition-size-percent.installfile new file mode 100644 index 0000000..da4ca7d --- /dev/null +++ b/tests/fixtures/0142-partition-size-percent.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 50% +mount /dev/sdb1 / diff --git a/tests/fixtures/0143-partition-size-percent-overflow.installfile b/tests/fixtures/0143-partition-size-percent-overflow.installfile new file mode 100644 index 0000000..d180063 --- /dev/null +++ b/tests/fixtures/0143-partition-size-percent-overflow.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 110% +mount /dev/sdb1 / diff --git a/tests/fixtures/0144-partition-size-fill.installfile b/tests/fixtures/0144-partition-size-fill.installfile new file mode 100644 index 0000000..3e01567 --- /dev/null +++ b/tests/fixtures/0144-partition-size-fill.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 fill +mount /dev/sdb1 / diff --git a/tests/fixtures/0145-partition-size-nonnumeric.installfile b/tests/fixtures/0145-partition-size-nonnumeric.installfile new file mode 100644 index 0000000..d83dd8a --- /dev/null +++ b/tests/fixtures/0145-partition-size-nonnumeric.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 abc123 +mount /dev/sdb1 / diff --git a/tests/fixtures/0146-partition-size-bad-suffix.installfile b/tests/fixtures/0146-partition-size-bad-suffix.installfile new file mode 100644 index 0000000..01858f1 --- /dev/null +++ b/tests/fixtures/0146-partition-size-bad-suffix.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 10h +mount /dev/sdb1 / diff --git a/tests/fixtures/0147-partition-size-overflow.installfile b/tests/fixtures/0147-partition-size-overflow.installfile new file mode 100644 index 0000000..ae4d159 --- /dev/null +++ b/tests/fixtures/0147-partition-size-overflow.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 9999999999999999999999 +mount /dev/sdb1 / diff --git a/tests/fixtures/0148-partition-size-overflow-k.installfile b/tests/fixtures/0148-partition-size-overflow-k.installfile new file mode 100644 index 0000000..2e94c1e --- /dev/null +++ b/tests/fixtures/0148-partition-size-overflow-k.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 9999999999999999999K +mount /dev/sdb1 / diff --git a/tests/fixtures/0149-partition-size-overflow-m.installfile b/tests/fixtures/0149-partition-size-overflow-m.installfile new file mode 100644 index 0000000..7144534 --- /dev/null +++ b/tests/fixtures/0149-partition-size-overflow-m.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 9999999999999999999M +mount /dev/sdb1 / diff --git a/tests/fixtures/0150-partition-size-overflow-g.installfile b/tests/fixtures/0150-partition-size-overflow-g.installfile new file mode 100644 index 0000000..8a21811 --- /dev/null +++ b/tests/fixtures/0150-partition-size-overflow-g.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 99999999999G +mount /dev/sdb1 / diff --git a/tests/fixtures/0151-partition-size-overflow-t.installfile b/tests/fixtures/0151-partition-size-overflow-t.installfile new file mode 100644 index 0000000..7cd707b --- /dev/null +++ b/tests/fixtures/0151-partition-size-overflow-t.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 19999999T +mount /dev/sdb1 / diff --git a/tests/fixtures/0152-partition-type-boot.installfile b/tests/fixtures/0152-partition-type-boot.installfile new file mode 100644 index 0000000..56f86d6 --- /dev/null +++ b/tests/fixtures/0152-partition-type-boot.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 fill boot +mount /dev/sdb1 / diff --git a/tests/fixtures/0153-partition-type-esp.installfile b/tests/fixtures/0153-partition-type-esp.installfile new file mode 100644 index 0000000..2556772 --- /dev/null +++ b/tests/fixtures/0153-partition-type-esp.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 fill esp +mount /dev/sdb1 / diff --git a/tests/fixtures/0154-partition-type-none.installfile b/tests/fixtures/0154-partition-type-none.installfile new file mode 100644 index 0000000..3e01567 --- /dev/null +++ b/tests/fixtures/0154-partition-type-none.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 fill +mount /dev/sdb1 / diff --git a/tests/fixtures/0155-partition-type-invalid.installfile b/tests/fixtures/0155-partition-type-invalid.installfile new file mode 100644 index 0000000..73e8282 --- /dev/null +++ b/tests/fixtures/0155-partition-type-invalid.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 fill huh +mount /dev/sdb1 / diff --git a/tests/fixtures/0156-partition-num-nonnumeric.installfile b/tests/fixtures/0156-partition-num-nonnumeric.installfile new file mode 100644 index 0000000..2335a7d --- /dev/null +++ b/tests/fixtures/0156-partition-num-nonnumeric.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb a fill +mount /dev/sdb1 / diff --git a/tests/fixtures/0157-partition-nonblock.installfile b/tests/fixtures/0157-partition-nonblock.installfile new file mode 100644 index 0000000..8c24d27 --- /dev/null +++ b/tests/fixtures/0157-partition-nonblock.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/console 1 fill +mount /dev/loop0 / diff --git a/tests/fixtures/0158-partition-nondev.installfile b/tests/fixtures/0158-partition-nondev.installfile new file mode 100644 index 0000000..1cdb905 --- /dev/null +++ b/tests/fixtures/0158-partition-nondev.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition sdb 1 fill +mount /dev/sdb1 / diff --git a/tests/fixtures/0159-partition-num-duplicate.installfile b/tests/fixtures/0159-partition-num-duplicate.installfile new file mode 100644 index 0000000..afddf25 --- /dev/null +++ b/tests/fixtures/0159-partition-num-duplicate.installfile @@ -0,0 +1,9 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 fill +partition /dev/sdb 1 fill +mount /dev/sdb1 / diff --git a/tests/fixtures/0160-partition-missing-num.installfile b/tests/fixtures/0160-partition-missing-num.installfile new file mode 100644 index 0000000..2f224ee --- /dev/null +++ b/tests/fixtures/0160-partition-missing-num.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb +mount /dev/sdb1 / diff --git a/tests/fixtures/0161-partition-missing-size.installfile b/tests/fixtures/0161-partition-missing-size.installfile new file mode 100644 index 0000000..8022692 --- /dev/null +++ b/tests/fixtures/0161-partition-missing-size.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 +mount /dev/sdb1 / diff --git a/tests/fixtures/0162-partition-size-case.installfile b/tests/fixtures/0162-partition-size-case.installfile new file mode 100644 index 0000000..f4d9450 --- /dev/null +++ b/tests/fixtures/0162-partition-size-case.installfile @@ -0,0 +1,8 @@ +network false +hostname test.machine +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +diskid /dev/sdb WDBNCE2500PNC +disklabel /dev/sdb gpt +partition /dev/sdb 1 FiLl +mount /dev/sdb1 / diff --git a/tests/spec/validator_spec.rb b/tests/spec/validator_spec.rb index 457aa93..df504ca 100644 --- a/tests/spec/validator_spec.rb +++ b/tests/spec/validator_spec.rb @@ -629,6 +629,165 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do expect(last_command_started).to have_output(/error: .*disklabel.*type/) end end + context "for 'partition' key" do + it "succeeds with a typical value" do + use_fixture '0135-partition-basic.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + context "size value" do + it "supports bytes" do + use_fixture '0136-partition-size-bytes.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "supports kilobytes (K)" do + use_fixture '0137-partition-size-kbytes.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "supports megabytes (M)" do + use_fixture '0138-partition-size-mbytes.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "supports gigabytes (G)" do + use_fixture '0139-partition-size-gbytes.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "supports terabytes (T)" do + use_fixture '0140-partition-size-tbytes.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 support exabytes (E)" do + use_fixture '0141-partition-size-ebytes.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*suffix/) + end + it "supports percentages" do + use_fixture '0142-partition-size-percent.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 support percentages over 100" do + use_fixture '0143-partition-size-percent-overflow.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*too large/) + end + it "supports the literal value 'fill'" do + use_fixture '0144-partition-size-fill.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 support non-numeric values" do + use_fixture '0145-partition-size-nonnumeric.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*number/) + end + it "does not support incorrect suffixes" do + use_fixture '0146-partition-size-bad-suffix.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*suffix/) + end + it "correctly handles byte overflow" do + use_fixture '0147-partition-size-overflow.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*too large/) + end + it "correctly handles kilobyte overflow (K)" do + use_fixture '0148-partition-size-overflow-k.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*too large/) + end + it "correctly handles megabyte overflow (M)" do + use_fixture '0149-partition-size-overflow-m.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*too large/) + end + it "correctly handles gigabyte overflow (G)" do + use_fixture '0150-partition-size-overflow-g.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*too large/) + end + it "correctly handles terabyte overflow (T)" do + use_fixture '0151-partition-size-overflow-t.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*too large/) + end + it "supports mixed-case 'fill'" do + use_fixture '0162-partition-size-case.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + end + context "type code" do + it "handles 'boot'" do + use_fixture '0152-partition-type-boot.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "handles 'esp'" do + use_fixture '0153-partition-type-esp.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "handles no value" do + use_fixture '0154-partition-type-none.installfile' + run_validate + expect(last_command_started).to have_output(PARSER_SUCCESS) + expect(last_command_started).to have_output(VALIDATOR_SUCCESS) + end + it "errors on invalid type code" do + use_fixture '0155-partition-type-invalid.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*partition.*invalid/) + end + end + it "errors on non-numeric partition number" do + use_fixture '0156-partition-num-nonnumeric.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*partition.*number/) + end + it "requires a block device" do + use_fixture '0157-partition-nonblock.installfile' + run_validate ' -i' + skip "This build does not support this test" if last_command_started.stdout =~ /runtime environment only/ + expect(last_command_started).to have_output(/error: .*partition.*block/) + end + it "requires an absolute device path" do + use_fixture '0158-partition-nondev.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*partition.*device/) + end + it "requires partition numbers to be unique per block device" do + use_fixture '0159-partition-num-duplicate.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*partition.*already exists/) + end + it "requires a partition number" do + use_fixture '0160-partition-missing-num.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*partition.*expected/) + end + it "requires a size" do + use_fixture '0161-partition-missing-size.installfile' + run_validate + expect(last_command_started).to have_output(/error: .*partition.*size/) + end + end end context "unique keys" do # Runner.Validate.network. |