misc: avoid permission issue when running envoy 94/37394/2
authorMaros Ondrejicka <maros.ondrejicka@pantheon.tech>
Thu, 13 Oct 2022 13:38:17 +0000 (15:38 +0200)
committerMaros O <maros.ondrejicka@pantheon.tech>
Thu, 13 Oct 2022 13:54:25 +0000 (13:54 +0000)
Because envoy didn't have permission for `envoy.log` file it would stop.
This made tests involving envoy fail.
Adding `ENVOY_UID` environment variable makes envoy run as root,
which avoids the problem.

Type: fix
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I910416ad1c87137396e7da89c13de7739ce74c70

.gitignore
extras/hs-test/utils.go

index aba513c..be94f09 100644 (file)
@@ -123,3 +123,7 @@ compile_commands.json
 # No test log files
 **/test-run-*-*-*
 
+# host stack test framework
+/extras/hs-test/vpp-data
+/extras/hs-test/hs-test
+/extras/hs-test/http_server
index 2530359..ba40bee 100755 (executable)
@@ -207,6 +207,7 @@ func startEnvoy(ctx context.Context, dockerInstance string) <-chan error {
                "-v", fmt.Sprintf("%s/envoy/proxy.yaml:/etc/envoy/envoy.yaml", wd),
                "-v", fmt.Sprintf("shared-vol:/tmp/%s", dockerInstance),
                "-v", fmt.Sprintf("%s/envoy:/tmp", wd),
+               "-e", "ENVOY_UID=0",
                "-e", "VCL_CONFIG=/tmp/vcl.conf",
                "envoyproxy/envoy-contrib:v1.21-latest"}
        fmt.Println(c)
@@ -221,7 +222,7 @@ func startEnvoy(ctx context.Context, dockerInstance string) <-chan error {
                                break
                        }
                        if count > 5 {
-                               errCh <- fmt.Errorf("Failed to start envoy docker after %d attempts", count)
+                               errCh <- fmt.Errorf("failed to start envoy docker after %d attempts", count)
                                return
                        }
                }