try passing positional args instead

This commit is contained in:
Jean-Paul Calderone 2018-06-15 15:40:50 -04:00
parent 7d74e042a3
commit 9abb323d31
4 changed files with 19 additions and 4 deletions

View File

@ -3,6 +3,9 @@
PROJECT=$1
shift
EXTRA_PACKAGES=$1
shift
# Avoid the /nonexistent home directory in nobody's /etc/passwd entry.
usermod --home /tmp/nobody nobody

View File

@ -227,17 +227,17 @@ jobs:
- run:
<<: *BOOTSTRAP_TEST_ENVIRONMENT
command: |
sudo --preserve-env ~/project/.circleci/bootstrap-test-environment.sh ~/project
sudo ~/project/.circleci/bootstrap-test-environment.sh ~/project "${EXTRA_PACKAGES}"
- run:
<<: *SETUP_VIRTUALENV
command: |
sudo --preserve-env /tmp/project/.circleci/setup-virtualenv.sh
sudo /tmp/project/.circleci/setup-virtualenv.sh "${TAHOE_LAFS_TOX_ENVIRONMENT}" ${TAHOE_LAFS_TOX_ARGS}
- run:
<<: *RUN_TESTS
command: |
sudo --preserve-env /tmp/project/.circleci/run-tests.sh
sudo /tmp/project/.circleci/run-tests.sh "${TAHOE_LAFS_TOX_ENVIRONMENT}" ${TAHOE_LAFS_TOX_ARGS}
- store_artifacts: *STORE_TEST_LOG
- store_artifacts: *STORE_OTHER_ARTIFACTS

View File

@ -1,5 +1,11 @@
#!/bin/bash -e
TAHOE_LAFS_TOX_ENVIRONMENT=$1
shift
TAHOE_LAFS_TOX_ARGS=$1
shift
# Run the test suite as a non-root user. This is the expected usage some
# small areas of the test suite assume non-root privileges (such as unreadable
# files being unreadable).
@ -7,4 +13,4 @@
# Also run with /tmp as a workdir because the non-root user won't be able to
# create the tox working filesystem state in the source checkout because it is
# owned by root.
sudo --set-home -u nobody /tmp/tests/bin/tox -c /tmp/project/tox.ini --workdir /tmp -e ${TAHOE_LAFS_TOX_ENVIRONMENT}
sudo --set-home -u nobody /tmp/tests/bin/tox -c /tmp/project/tox.ini --workdir /tmp -e "${TAHOE_LAFS_TOX_ENVIRONMENT}" ${TAHOE_LAFS_TOX_ARGS}

View File

@ -1,5 +1,11 @@
#!/bin/bash -e
TAHOE_LAFS_TOX_ENVIRONMENT=$1
shift
TAHOE_LAFS_TOX_ARGS=$1
shift
# Set up the virtualenv as a non-root user so we can run the test suite as a
# non-root user. See below.
sudo --set-home -u nobody virtualenv --python python2.7 /tmp/tests