e2e tests assume non-root user

This commit is contained in:
Mahmood Ali 2019-10-18 09:21:13 -04:00
parent c26866c0c8
commit e498bb951c

View file

@ -153,8 +153,20 @@ jobs:
GOPATH: /go
steps:
- checkout
- run: make deps
- run: make e2e-test
- run: apt-get update; apt-get install -y sudo unzip
# e2e tests require privileged mount/umount permissions when running as root
# TODO: switch to using machine executor and run as root to test e2e path
- run:
name: prepare non-root user
command: |
groupadd --gid 3434 circleci
useradd --uid 3434 --gid circleci --shell /bin/bash --create-home circleci
echo 'circleci ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci
echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
chown -R circleci:circleci /go
- run: sudo -E -H -u circleci PATH=${PATH} make deps
- run: sudo -E -H -u circleci PATH=${PATH} make e2e-test
test-website:
executor: go-machine-recent