Skip to content

Commit e44958c

Browse files
licliucoiby
authored andcommitted
unit tests: Add case for quoted configuration values
This adds a unit test to ensure `kdump_get_conf_val` correctly strips surrounding quotes from configuration options. This test case covers the bug fixed in the previous commit. Signed-off-by: Lichen Liu <[email protected]>
1 parent 1a73387 commit e44958c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spec/kdump-lib-initramfs_spec.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Describe 'kdump-lib-initramfs'
1212
#|dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"
1313
#|sshkey /root/.ssh/kdump_id_rsa
1414
15+
#|core_collector "makedumpfile -l --message-level 7 -d 31"
1516
}
1617
kdump_config >$KDUMP_CONFIG_FILE
1718
Context 'Given different cases'
@@ -21,13 +22,15 @@ Describe 'kdump-lib-initramfs'
2122
# - complicate value for dracut_args
2223
# - Given two parameters, retrive one parameter that has value specified
2324
# - Given two parameters (in reverse order), retrive one parameter that has value specified
25+
# - values are enclosed in quotes
2426
Parameters
2527
"#1" nfs my.server.com:/export/tmp
2628
2729
"#3" failure_action shell
2830
"#4" dracut_args '--omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"'
2931
"#5" 'ssh\|aaa' [email protected]
3032
"#6" 'aaa\|ssh' [email protected]
33+
"#7" core_collector "makedumpfile -l --message-level 7 -d 31"
3134
End
3235

3336
It 'should handle all cases correctly'

0 commit comments

Comments
 (0)