diff options
| author | Zygmunt Krynicki <me@zygoon.pl> | 2019-05-29 12:08:13 +0200 |
|---|---|---|
| committer | Zygmunt Krynicki <me@zygoon.pl> | 2019-05-29 12:13:27 +0200 |
| commit | 0d915a46babe5e5224f976620ab7692fdb01ad02 (patch) | |
| tree | 8b089b316355a5795bf75f196c1302f472afdcc5 /tests/unit | |
| parent | 839879f2ef721bd8d699677f23bef552f1a04562 (diff) | |
tests: correct application of ! / not
A single test started failing after introduction of the "not" program. The specific code was (broken down for readability): su -l -c 'test-snapd-sh.with-home-plug -c \ "ln /home/test/snap/test-snapd-sh/common/evil-2 /home/test/bin/evil-2"' test \ 2>&1 | not MATCH '.* Permission denied' Originally there was a `!` in front of the entire expression. At runtime we observe the actual denial, that is symlinking from `$SNAP_USER_COMMON` to `$HOME/bin` is correctly denied, but with, now correctly working negation, it started to fail the test. I'm unsure as to why this happened but a working theory is that the prior approach was designed for `set -o pipefail`, where the `su` command would return the result of failing `ln` command which would cause the whole pipe expression to fail. The fix is to simply remove the negation, since the test works as expected exactly as-is. Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
Diffstat (limited to 'tests/unit')
0 files changed, 0 insertions, 0 deletions
