From df50ed4b4566cd87bc890dfd2279e6be3347819d Mon Sep 17 00:00:00 2001
From: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
Date: Fri, 19 Nov 2021 14:11:32 +0100
Subject: [PATCH] spread.yaml: add support for local squid-deb-proxy-client

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
---
 spread.yaml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/spread.yaml b/spread.yaml
index 5138ad9..cf0a7d8 100644
--- a/spread.yaml
+++ b/spread.yaml
@@ -28,8 +28,15 @@ environment:
     # Use non-volatile tmp as the tests may REBOOT.
     TEST_RAUC_KEYS_DIR: /var/tmp/rauc-keys
     TEST_RAUC_FAKE_SYSTEM_DIR: /var/tmp/rauc-fake-system
+    HOST_APT_PROXY: "$(HOST: /usr/share/squid-deb-proxy-client/apt-avahi-discover 2>/dev/null)"
 
 prepare: |
+    set -x
+    if [ -n "$HOST_APT_PROXY" ]; then
+        printf 'Acquire::http::Proxy "%s";\n' "$HOST_APT_PROXY" >/etc/apt/apt.conf.d/00spread-apt-proxy.conf
+    fi
+
+
     # Install build dependencies if missing.
     test -n "$(command -v go)" && test -f /usr/include/z.mk && test -f /lib/systemd/system/rauc.service && test -n "$(command -v mksquashfs)" && test -n "$(command -v jq)" && test -n "$(command -v mandb)" && test -n "$(command -v strace)" || (
         apt-get update && apt-get install -y golang-go zmk rauc-service squashfs-tools jq man-db strace
-- 
GitLab