Coiby Xu
6506bd9b1b
unit tests: add tests for kdumpctl read_proc_environ_var and _is_osbuild
...
AfterAll is an example group hook [1] which would be run after the group
tests are executed. Use this hook to clean up the files created by mktemp.
[1] https://github.com/shellspec/shellspec#beforeall-afterall---example-group-hook
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
2022-04-14 11:44:54 +08:00
Coiby Xu
59386d5a8b
unit tests: add tests for get_dump_mode_by_fadump_val
...
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
2022-04-14 11:44:45 +08:00
Coiby Xu
93373c0406
unit tests: add tests for get_grub_kernel_boot_parameter
...
This test suite makes use of three features provided by ShellSpec
- funcion-based mock [2]: mock a function by re-defining and exporting it
- parameterized tests [3]: run multiple sets of input against the same
test
- %text directive [4]: similar to heredoc but free of
the indentation issue
Note
1. Describe and Context are aliases for ExampleGroup which a block for
grouping example groups or examples [5]. Describe and Context are used to
improve readability.
2. ShellSpec requires .shellspec file.
[1] https://github.com/dodie/testing-in-bash#detailed-comparision
[2] https://github.com/shellspec/shellspec#function-based-mock
[3] https://github.com/shellspec/shellspec#parameters---parameterized-example
[4] https://github.com/shellspec/shellspec#text---embedded-text
[5] https://github.com/shellspec/shellspec#dsl-syntax
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
2022-04-14 11:44:27 +08:00