Skip to content

Commit

Permalink
QA: improve the system
Browse files Browse the repository at this point in the history
1. make sure we run as unprivileged user in its home directory

2. share GOPATH and GOCACHE to avoid rebuilding every time

Part of #829
  • Loading branch information
bassosimone committed Jul 24, 2020
1 parent 659b1d6 commit 61fb707
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/.vscode
/QA/__pycache__/
/asn.mmdb
/badproxy.pem
/ca-bundle.pem
/country.mmdb
/fbmessenger.jsonl
/hhfm.jsonl
/jafar
/jafar.exe
/miniooni
Expand Down
3 changes: 3 additions & 0 deletions QA/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/GOPATH
/GOCACHE
/__pycache__
2 changes: 1 addition & 1 deletion QA/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def execute_jafar_and_miniooni(ooni_exe, outfile, experiment, tag, args):
"-main-command",
"%s -no '%s' %s" % (ooni_exe, outfile, experiment),
"-main-user",
os.environ["SUDO_USER"],
"ooniprobe", # created in cmd/jafar/Dockerfile
"-tag", tag,
]
+ args
Expand Down
1 change: 1 addition & 0 deletions QA/pyrun.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
set -ex
export GOPATH=/jafar/QA/GOPATH GOCACHE=/jafar/QA/GOCACHE GO111MODULE=on
go build -v ./cmd/miniooni
go build -v ./cmd/jafar
sudo ./QA/$1.py ./miniooni
2 changes: 1 addition & 1 deletion cmd/jafar/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM alpine:edge
RUN apk add go git musl-dev iptables tmux bind-tools curl sudo python3
ENV GOPATH=/go GO111MODULE=on
RUN adduser -D ooniprobe

0 comments on commit 61fb707

Please sign in to comment.