diff options
| author | Joseph Richey <joerichey@google.com> | 2022-08-18 19:06:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-18 19:06:15 -0700 |
| commit | a1ddf6e09af39320fee969f52d36ae0f2ca94d83 (patch) | |
| tree | be8cf4ab980e46b18316eb5f90677926ea83bedb /cli-tests/run.sh | |
| parent | f0c1cae003dd216ba706d7ef14df83d311c82034 (diff) | |
| parent | afad6a1e0521e52dfaffe937ecab2515a76b8134 (diff) | |
Merge pull request #362 from google/fix-cli-tests-2
cli-tests: account for protojson whitespace randomization
Diffstat (limited to 'cli-tests/run.sh')
| -rwxr-xr-x | cli-tests/run.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cli-tests/run.sh b/cli-tests/run.sh index f6a4868..9ab5b78 100755 --- a/cli-tests/run.sh +++ b/cli-tests/run.sh @@ -112,6 +112,10 @@ filter_test_output() # "bash: line 1: " instead of just "bash: ". Filter out the "line 1: ". sedscript+="s@^bash: line 1: @bash: @;" + # Work around protojson whitespace randomization. + sedscript+="/^Options: /s@ @ @g;" + sedscript+="s@^Options: @Options: @;" + sed -e "$sedscript" "$raw_output" } @@ -162,7 +166,7 @@ setup_for_test() fscrypt setup --time=1ms --quiet --all-users > /dev/null # The tests assume kernel support for v2 policies. - if ! grep -q '"policy_version": "2"' "$FSCRYPT_CONF"; then + if ! grep -E -q '"policy_version": +"2"' "$FSCRYPT_CONF"; then cat 1>&2 << EOF ERROR: Can't run these tests because your kernel doesn't support v2 policies. You need kernel v5.4 or later. |