-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Reagan Bohan <[email protected]>
- Loading branch information
Showing
8 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
grubenv_tests = { | ||
'test.dmpstore.export' : ['testing export to DMPSTORE format', | ||
'@0@ -n {grub}-GRUB_ENV -f test.dmpstore.export.result.env -D -e test.dmpstore.export.result.var'], | ||
'test.efivar.export' : ['testing export to libefivar format', | ||
'@0@ -n {grub}-GRUB_ENV -f test.efivar.export.result.env -e test.efivar.export.result.var'], | ||
'test.grubenv.var.0' : ['test importing from DMPSTORE and exporting to DMPSTORE and symbolic guid-name validation', | ||
''' | ||
@0@ -n {grub}-GRUB_ENV -f test.grubenv.var.0.result.env -D -e test.grubenv.var.0.export.var | ||
@0@ -i test.grubenv.var.0.export.var -e test.grubenv.var.0.result.var -D | ||
'''], | ||
'test.grubenv.var.1' : ['test importing from DMPSTORE and exporting to libefivar', | ||
''' | ||
@0@ -n {grub}-GRUB_ENV -f test.grubenv.var.1.result.env -D -e test.grubenv.var.1.export.var | ||
@0@ -i test.grubenv.var.1.export.var -e test.grubenv.var.1.result.var | ||
'''], | ||
'test.grubenv.var.2' : ['test importing from libefivar and exporting to DMPSTORE and mixed-case guid-name validation', | ||
''' | ||
@0@ -n 91376aff-cBa6-42bE-949d-06fde81128e8-GRUB_ENV -f test.grubenv.var.2.result.env -e test.grubenv.var.2.export.var | ||
@0@ -i test.grubenv.var.2.export.var -e test.grubenv.var.2.result.var -D | ||
'''], | ||
'test.grubenv.var.3' : ['test importing from libefivar and exporting to libefivar and guid-name validation', | ||
''' | ||
@0@ -n 91376aff-cba6-42be-949d-06fde81128e8-GRUB_ENV -f test.grubenv.var.3.result.env -e test.grubenv.var.3.export.var | ||
@0@ -i test.grubenv.var.3.export.var -e test.grubenv.var.3.result.var | ||
'''], | ||
} | ||
|
||
# TODO test grub return disabler | ||
grub_wrapper = find_program('sh/_grubenv-test.sh') | ||
foreach grubtest, testinfo : grubenv_tests | ||
test(testinfo[0], grub_wrapper, args: ['grub-editenv', meson.current_source_dir(), grubtest, testinfo[1].format(efivar)]) | ||
endforeach | ||
|
||
|
||
efivar_tests = { | ||
'test.efivar.l' : 'testing efivar -L', | ||
'test.bootorder.var' : 'testing with BootOrder variable dmpstore generated', | ||
'test.conin.var' : 'testing with ConIn variable dmpstore generated', | ||
} | ||
|
||
foreach efivartest, testname : efivar_tests | ||
testprog = find_program('sh/' + efivartest + '.sh') | ||
test(testname, testprog, args: [efivar, meson.current_source_dir()]) | ||
endforeach | ||
|
||
efisecdb_tests = { | ||
'test.esl.dump.x509.sha256' : 'testing ESL dumping with x509 + sha256 sums', | ||
'test.parse.db' : 'testing parsing db variable', | ||
'test.esl.annotation' : 'testing ESL annotation with x509 + sha256 sums', | ||
'test.esl.sha256.unsorted' : 'testing ESL creation with sha256 sums (unsorted)', | ||
'test.esl.sha256.ascending' : 'testing ESL creation with sha256 sums (ascending)', | ||
'test.esl.sha256.removal.descending' : 'testing ESL entry removal with sha256 sums (descending)', | ||
'test.esl.sha256.addition.unsorted' : 'testing adding a sha256 sum to an existing ESL (unsorted)', | ||
'test.esl.cert.addition' : 'testing ESL entry addition with x509 cert', | ||
'test.esl.cert.removal' : 'testing ESL entry removal with x509 cert' | ||
} | ||
|
||
foreach efisectest, testname : efisecdb_tests = { | ||
|
||
} | ||
|
||
# Threading | ||
# tester.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh -eu | ||
|
||
# Usage: editenv dir testname torun | ||
|
||
"$1" "${3}.result.env" create | ||
"$1" "${3}.result.env" set debug=all,-scripting,-lexer | ||
truncate -s 512 "${3}.result.env" | ||
eval "$4" | ||
if grep -q "Do not edit" "${3}.result.env" ; then | ||
cmp "${3}.result.var" "${2}/${3}.new.goal.var" | ||
else | ||
cmp "${3}.result.var" "${2}/${3}.old.goal.var" | ||
fi | ||
rm -f "${3}.result."* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh -eu | ||
|
||
"$1" -i "${2}/test.bootorder.var.goal.var" -e test.bootorder.var.0.result.var | ||
"$1" -i test.bootorder.var.0.result.var -e test.bootorder.var.1.result.var -D | ||
cmp "${2}/test.bootorder.var.goal.var" test.bootorder.var.1.result.var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh -eu | ||
|
||
"$1" -i "${2}/test.conin.var.goal.var" -e test.conin.var.0.result.var | ||
"$1" -i test.conin.var.0.result.var -e test.conin.var.1.result.var -D | ||
cmp "${2}/test.conin.var.goal.var" test.conin.var.1.result.var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh -eu | ||
|
||
"$1" -L | grep -q '^{91376aff-cba6-42be-949d-06fde81128e8} {grub} efi_guid_grub GRUB$' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh -eu | ||
|
||
"$1" -i "${2}/test.esl.sha256.addition.unsorted.esl.goal" -A > test.esl.dump.x509.sha256.result.txt | ||
cmp "${2}/test.esl.dump.x509.sha256.goal.txt" test.esl.sha256.addition.unsorted.result.txt | ||
|