diff options
author | Chase Qi <chase.qi@linaro.org> | 2017-11-10 16:53:56 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-11-13 10:21:29 +0000 |
commit | 8c2502fc313007f2c34e1fff06235ab1fa3fc16f (patch) | |
tree | d26706db2c6fa45dda4bcdd33d33a50fa7c39c6e /automated | |
parent | 0d09fb828c620f80dc13c978505f85b9779824b7 (diff) |
linux: migrate overlayfs test to v2
Rewrite overlayfs test case in shell script to:
* Adapt v2 structure.
* Leverage functions from sh-test-lib
Change-Id: I2397827c0d1ec9708e652b1572248b7eea9dcd04
Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated')
-rwxr-xr-x | automated/linux/overlayfs/overlayfs.sh | 48 | ||||
-rw-r--r-- | automated/linux/overlayfs/overlayfs.yaml | 35 |
2 files changed, 83 insertions, 0 deletions
diff --git a/automated/linux/overlayfs/overlayfs.sh b/automated/linux/overlayfs/overlayfs.sh new file mode 100755 index 0000000..d871cbe --- /dev/null +++ b/automated/linux/overlayfs/overlayfs.sh @@ -0,0 +1,48 @@ +#!/bin/sh -ex + +TEST_DIR=$(dirname "$(realpath "$0")") +OUTPUT="${TEST_DIR}/output" +export RESULT_FILE="${OUTPUT}/result.txt" + +# shellcheck disable=SC1090 +. "${TEST_DIR}/../../lib/sh-test-lib" +create_out_dir "${OUTPUT}" +cd "${OUTPUT}" +# PKG install will be skipped on unsupported distro. +install_deps "git" +git clone http://git.linaro.org/qa/unionmount-testsuite.git +cd unionmount-testsuite + +tests="open-plain open-trunc open-creat open-creat-trunc open-creat-excl + open-creat-excl-trunc noent-plain noent-trunc noent-creat + noent-creat-trunc noent-creat-excl noent-creat-excl-trunc sym1-plain + sym1-trunc sym1-creat sym1-creat-excl sym2-plain sym2-trunc sym2-creat + sym2-creat-excl symx-plain symx-trunc symx-creat symx-creat-excl + symx-creat-trunc truncate dir-open dir-weird-open dir-open-dir + dir-weird-open-dir dir-sym1-open dir-sym1-weird-open dir-sym2-open + dir-sym2-weird-open readlink mkdir rmdir hard-link hard-link-dir + hard-link-sym unlink rename-file rename-empty-dir rename-new-dir + rename-pop-dir rename-new-pop-dir rename-move-dir rename-mass + rename-mass-2 rename-mass-3 rename-mass-4 rename-mass-5 rename-mass-dir + rename-mass-sym impermissible" + +if which python3; then + py_cmd="python3" +else + py_cmd="python2" +fi + +for test in ${tests}; do + for term_slash in 0 1; do + if [ "${term_slash}" -eq 1 ]; then + suffix="-termslash" + else + suffix="" + fi + + test_cmd="${py_cmd} ./run --ov --ts=${term_slash} ${test}" + info_msg "Running $test with command: ${test_cmd}" + # run_test_case() usage: run_test_case test_cmd test_case_id + run_test_case "${test_cmd}" "${test}${suffix}" + done +done diff --git a/automated/linux/overlayfs/overlayfs.yaml b/automated/linux/overlayfs/overlayfs.yaml new file mode 100644 index 0000000..f3d8918 --- /dev/null +++ b/automated/linux/overlayfs/overlayfs.yaml @@ -0,0 +1,35 @@ +metadata: + name: overlayfs + format: "Lava-Test-Shell Test Definition 1.0" + description: "Run overlay filesystem test from unionmount testsuite. Kernel config + CONFIG_OVERLAY_FS=y is required for this test." + maintainer: + - milosz.wasilewski@linaro.org + - chase.qi@linaro.org + os: + - ubuntu + - debian + - centos + - fedora + - openembedded + devices: + - d03 + - d05 + - juno + - beaglebone-black + - hi6220-hikey + - apq8016-sbc + - mustang + - moonshot + - thunderX + - x15 + - x86 + + scope: + - functional + +run: + steps: + - cd automated/linux/overlayfs + - ./overlayfs.sh + - ../../utils/send-to-lava.sh ./output/result.txt |