From: DANIEL STOICA Date: Tue, 12 May 2020 11:12:26 +0000 (+0300) Subject: Change go version for vuls tests X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F18%2F3418%2F2;p=validation.git Change go version for vuls tests Change go version in go1.14 because vuls no longer supports verison 1.12.6 Change GOPATH because go1.14 don't accept to set GOPATH in go/src Signed-off-by: DANIEL STOICA Change-Id: I2df1857ab0b58879051f027320ac95b353ed58ad --- diff --git a/docker/os/Dockerfile b/docker/os/Dockerfile index 42e67fe..2e7f36a 100644 --- a/docker/os/Dockerfile +++ b/docker/os/Dockerfile @@ -62,13 +62,13 @@ RUN git clone https://github.com/CISOfy/lynis && tar czvf /opt/akraino/lynis-rem # Fetches vuls databases (invalidate cache using unique timestamp) SHELL ["/bin/bash", "-c"] RUN if [ $(uname -m) == 'aarch64' ]; then HOST_ARCH=arm64; else HOST_ARCH=amd64; fi && \ - wget https://dl.google.com/go/go1.12.6.linux-$HOST_ARCH.tar.gz -P /root/ --progress=dot:giga && \ + wget https://dl.google.com/go/go1.14.linux-$HOST_ARCH.tar.gz -P /root/ --progress=dot:giga && \ cd /root/ && \ - tar -xzf go1.12.6.linux-$HOST_ARCH.tar.gz -C /root/ && \ - rm go1.12.6.linux-$HOST_ARCH.tar.gz && \ + tar -xzf go1.14.linux-$HOST_ARCH.tar.gz -C /root/ && \ + rm go1.14.linux-$HOST_ARCH.tar.gz && \ export GOROOT=/root/go && \ - export GOPATH=/root/go/src && \ - export PATH=$PATH:/root/go/bin:/root/go/src/bin && \ + export GOPATH=/root/go/src/github.com && \ + export PATH=$PATH:/root/go/bin:/root/go/src/github.com/bin && \ mkdir -p /root/go/src/github.com/future-architect && \ cd /root/go/src/github.com/future-architect && \ git clone https://github.com/future-architect/vuls && \ @@ -90,8 +90,8 @@ ADD db.tar.gz /opt/akraino/validation/tests/os/vuls/ ADD db.tar.gz.timestamp /root/ RUN \ export GOROOT=/root/go && \ - export GOPATH=/root/go/src && \ - export PATH=$PATH:/root/go/bin:/root/go/src/bin && \ + export GOPATH=/root/go/src/github.com && \ + export PATH=$PATH:/root/go/bin:/root/go/src/github.com/bin && \ for i in $(seq 2002 "$(date +"%Y")"); do go-cve-dictionary fetchnvd -quiet -http-proxy=${HTTP_PROXY} -dbpath /opt/akraino/validation/tests/os/vuls/cve.sqlite3 -years "$i"; done && \ goval-dictionary fetch-ubuntu -http-proxy=${HTTP_PROXY} -dbpath=/opt/akraino/validation/tests/os/vuls/oval_ubuntu_16.sqlite3 16 && \ goval-dictionary fetch-ubuntu -http-proxy=${HTTP_PROXY} -dbpath=/opt/akraino/validation/tests/os/vuls/oval_ubuntu_18.sqlite3 18 && \ @@ -108,7 +108,7 @@ COPY --from=build /opt/akraino/validation /opt/akraino/validation COPY --from=build /opt/akraino/ltp.tar.gz /opt/akraino/ltp.tar.gz COPY --from=build /opt/akraino/lynis-remote.tar.gz /opt/akraino/lynis-remote.tar.gz COPY --from=build /root/go/bin /root/go/bin -COPY --from=build /root/go/src/bin /root/go/src/bin +COPY --from=build /root/go/src/github.com/bin /root/go/src/github.com/bin RUN apt-get update && apt-get -y install \ python3-pip python3.6 && \ diff --git a/tests/os/vuls/vuls.robot b/tests/os/vuls/vuls.robot index 3c40181..6095ffb 100644 --- a/tests/os/vuls/vuls.robot +++ b/tests/os/vuls/vuls.robot @@ -27,8 +27,8 @@ Suite Teardown Run Keywords *** Test Cases *** Run Vuls test Set Environment Variable GOROOT /root/go - Set Environment Variable GOPATH /root/go/src - Set Environment Variable PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/go/bin:/root/go/src/bin + Set Environment Variable GOPATH /root/go/src/github.com + Set Environment Variable PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/go/bin:/root/go/src/github.com/bin Set Environment Variable LC_ALL en_US.UTF-8 Set Environment Variable LANG en_US.UTF-8