mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
* Adding more details to tests - part 13 * Add more details * adding more tests * Update tests/main/debs/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/debug-sandbox/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/econnreset/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/enable-disable/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/health/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/snap-validate-enforce/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/snap-validate-with-store/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/enable-disable/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/debug-paths/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/default-tracks/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> * Update tests/main/enable-disable/task.yaml Co-authored-by: Miguel Pires <miguelpires94@gmail.com> --------- Co-authored-by: Miguel Pires <miguelpires94@gmail.com>
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
summary: Ensure that the core.proxy.* settings are honored
|
|
|
|
details: |
|
|
Snapd provides the core.proxy.* config which can be used to setup the proxy used.
|
|
|
|
This test verifies that when a proxy config is set, the snapd commands go through
|
|
the proxy.
|
|
|
|
# ubuntu-14.04 does not have systemd-run
|
|
systems: [-ubuntu-14.04-*]
|
|
|
|
restore: |
|
|
snap set core proxy.https=
|
|
systemctl stop tinyproxy || true
|
|
|
|
execute: |
|
|
if ! command -v python3; then
|
|
echo "SKIP: need python3"
|
|
exit 0
|
|
fi
|
|
if [ -n "${http_proxy:-}" ] || [ -n "${https_proxy:-}" ] ||
|
|
[ -n "${HTTPS_PROXY:-}" ] || [ -n "${HTTPS_PROXY:-}" ]; then
|
|
echo "SKIP: cannot run when there is another http proxy"
|
|
exit 0
|
|
fi
|
|
|
|
systemd-run --service-type=notify --unit tinyproxy -- python3 "$TESTSLIB/tinyproxy/tinyproxy.py"
|
|
tests.systemd wait-for-service -n 30 --state active tinyproxy
|
|
|
|
echo "Setup proxy config"
|
|
snap set core proxy.https=http://localhost:3128
|
|
|
|
echo "Check that the commands go through the proxy"
|
|
snap find test-snapd-tools | MATCH test-snapd-tools
|
|
|
|
# check unit output
|
|
"$TESTSTOOLS"/journal-state match-log 'CONNECT api.snapcraft.io' -u tinyproxy
|