summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2017-10-23 18:36:04 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2017-10-24 14:05:14 +0800
commitf5e6b93ba115a5881dcac572889834a02069b368 (patch)
tree403c91a40ad7be2b512ebc60d611af9ec2a460f2
parentce33f2c425e30d00b7fec5edad80c6df940961f8 (diff)
android tradefed: workaround for chown testuser home directory
This change is to workaround the problem happened here: https://staging.validation.linaro.org/scheduler/job/194317#L5332 With adding more debug information, found that the problem is caused by command of "chown testuser.testuser /home/testuser", not sure why yet, but changing to create the home directory with the useradd command could help to workaround that problem. Also deleting that testuser before creating to make sure the useradd command executed successfully, and delete that testuser after the test finished. Change-Id: Icfd0dd1aa931a31d411e5e562c457d8c3ab007a7 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--automated/android/tradefed/tradefed.yaml8
1 files changed, 6 insertions, 2 deletions
diff --git a/automated/android/tradefed/tradefed.yaml b/automated/android/tradefed/tradefed.yaml
index 4d3d467..5d6515e 100644
--- a/automated/android/tradefed/tradefed.yaml
+++ b/automated/android/tradefed/tradefed.yaml
@@ -35,8 +35,11 @@ run:
- cd ./automated/android/tradefed
# Run setup.sh in the original shell to reserve env variables.
- . ./setup.sh
- - id -u testuser &>/dev/null || useradd testuser
- - mkdir -p /home/testuser; chown testuser.testuser /home/testuser
+ - echo "after ./setup.sh"
+ # delete the test user to clean environment
+ - userdel testuser -r -f || true
+ # create test use to run the cts/vts tests
+ - useradd -m testuser && echo "testuser created successfully"
- sudo -u testuser ./tradefed.sh -o "${TIMEOUT}" -c "${TEST_URL}" -t "${TEST_PARAMS}" -p "${TEST_PATH}" -r "${RESULTS_FORMAT}" -n "${ANDROID_SERIAL}"
# Upload test log and result files to artifactorial.
- cp -r ./${TEST_PATH}/results ./output/ || true
@@ -46,3 +49,4 @@ run:
- ../../utils/upload-to-artifactorial.sh -a "${ATTACHMENT}" -u "${URL}" -t "${TOKEN}"
# Send test result to LAVA.
- ../../utils/send-to-lava.sh ./output/result.txt
+ - userdel testuser -f -r || true