Files
snapd/tests/completion/simple/task.yaml
Zygmunt Krynicki dd2c9ebc95 tests/completion: document the "three" completion tests
There are "three" completion tests that multiply with the large number of
variatns present in the suite. The "simple" test is unsual and I don't fully
understand how it works because it does not install the test-snapd-complexion
snap at all. Instead it relies on running the completion script directly,
without the snap complete/etelpmoc script pair working across the sandbox.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2024-04-30 14:14:02 +02:00

28 lines
1.2 KiB
YAML

summary: simple completion
details: |
Snapd contains a special system for tab-completion of snap applications, where
the bulk of the completion logic runs under confinement, and communicates with
a trusted, unconfined helper provided by snapd.
Like all the other completion tests, this test relies on a set of files
$variant.{complete,sh,vars} where foo $variant is one of the many variants of
the tests/complete suite: plain, plain_plusdirs, funky, files, hosts,
hosts_n_dirs, func, funkyfunc, funcarg. In each case the .vars file adds
environment variables needed by the test, the .sh script is executed during
test setup and the .complete script replaces the bash completer in the
test-snapd-complexion snap.
Like all the other completion tests this test is mostly implemented with
expect(1) to interact with bash, send and receive snippets of text.
This test relies bypasses the complete.sh/etelpmoc.sh pair of scripts and does
not communicate across the barrier created by the snap execution sandbox.
execute: |
d="$PWD"
#shellcheck disable=SC1090
source "${SPREAD_PATH}/${SPREAD_SUITE}/${SPREAD_VARIANT}.vars"
export _OUT0 _OUT1 _OUT2 _KEY1 _KEY2 _COMP
expect -d -f "$d"/task.exp