Hi Pingfan,
On Fri, Nov 25, 2022 at 11:08:46AM +0800, Pingfan Liu wrote:
Now, kdump.conf is generated by gen-kdump-conf.sh, hence adapting
check_config to run that script firstly then check the generated file.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
spec/kdumpctl_general_spec.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
index 5a3ce1c..44294a5 100644
--- a/spec/kdumpctl_general_spec.sh
+++ b/spec/kdumpctl_general_spec.sh
@@ -178,6 +178,7 @@ Describe 'kdumpctl'
bad_kdump_conf=$(mktemp -t bad_kdump_conf.XXXXXXXXXX)
cleanup() {
rm -f "$bad_kdump_conf"
+ rm -f kdump.conf
}
AfterAll 'cleanup'
@@ -189,8 +190,16 @@ Describe 'kdumpctl'
The stderr should include 'Invalid kdump config option blabla'
End
+ Parameters
+ aarch64
+ ppc64le
+ s390x
+ x86_64
+ End
You can use a more succinct syntax `Parameters:value` [1], i.e.
Parameters:value aarch64 ppc64le s390x x86_64
It 'should be happy with the default kdump.conf'
...
End
https://github.com/shellspec/shellspec/blob/master/docs/references.md#par...
+
It 'should be happy with the default kdump.conf'
# shellcheck disable=SC2034
+ ./gen-kdump-conf.sh x86_64 > kdump.conf
I think you don't want to only check x86_64. So you can use "$1" to
refer the 1st parameter.
# override the KDUMP_CONFIG_FILE variable
KDUMP_CONFIG_FILE=./kdump.conf
Btw, you need to generate kdump.conf after the above line since
the "# shellcheck disable" directive isn't for ./gen-kdump-conf.sh.
When call parse_config
--
Best regards,
Coiby