From e62848752561640ecad72901938d0c0c5c17ed9a Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 23 Sep 2020 15:16:11 -0600 Subject: system tests: helpers: safer parse_table The parse_table() helper has until now dumbly split lines on every single '|' character. This prevents us from running simple tests such as 'cgroupManager: (systemd|cgroupfs)'. We now use an ugly but robust sed expression to split on '|' but *only* when surrounded by spaces and/or beginning or end of line. This is safe because, for readability, all tables already keep the '|' symbols well separated from table content. Add tests. And, the whole reason behind this, add an actual real test for cgroupManager and cgroupVersion. Signed-off-by: Ed Santiago --- test/system/005-info.bats | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/system/005-info.bats') diff --git a/test/system/005-info.bats b/test/system/005-info.bats index ef3e97af0..7452c1901 100644 --- a/test/system/005-info.bats +++ b/test/system/005-info.bats @@ -19,8 +19,8 @@ graphRoot: graphStatus: imageStore:\\\s\\\+number: 1 runRoot: -cgroupManager: -cgroupVersion: v +cgroupManager: \\\(systemd\\\|cgroupfs\\\) +cgroupVersion: v[12] " while read expect; do is "$output" ".*$expect" "output includes '$expect'" @@ -36,6 +36,8 @@ cgroupVersion: v tests=" host.buildahVersion | [0-9.] host.conmon.path | $expr_path +host.cgroupManager | \\\(systemd\\\|cgroupfs\\\) +host.cgroupVersion | v[12] host.ociRuntime.path | $expr_path store.configFile | $expr_path store.graphDriverName | [a-z0-9]\\\+\\\$ -- cgit v1.2.3-54-g00ecf