From 30987c3079f1b535117d60a996a36d274fa4da9e Mon Sep 17 00:00:00 2001 From: Ole Petter Date: Tue, 24 Nov 2020 14:45:26 +0100 Subject: [PATCH] Add the new mender-image-tests submodule This now isolates all files to mender-image-tests Changelog: None Signed-off-by: Ole Petter --- scripts/test/test-utils.sh | 23 +++++++++-------------- tests/conftest.py | 10 ++++++++++ tests/mender-image-tests | 2 +- tests/pytest.ini | 2 ++ 4 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 tests/conftest.py create mode 100644 tests/pytest.ini diff --git a/scripts/test/test-utils.sh b/scripts/test/test-utils.sh index 3383fae..1ef608b 100644 --- a/scripts/test/test-utils.sh +++ b/scripts/test/test-utils.sh @@ -124,7 +124,7 @@ run_tests() { mv $file "${file%.img}.sdimg" done - cd ${WORKSPACE}/mender-image-tests + cd ${WORKSPACE} echo "Converted image name: " echo "$converted_image_name" @@ -138,9 +138,9 @@ run_tests() { --board-type="${device_type}" \ --mender-image="${converted_image_name}.sdimg" \ --sdimg-location="${MENDER_CONVERT_DIR}/deploy" \ - --ssh-priv-key="../ssh-priv-key/key" \ - --qemu-wrapper="../../scripts/test/mender-convert-qemu" \ - tests \ + --ssh-priv-key="./ssh-priv-key/key" \ + --qemu-wrapper="../scripts/test/mender-convert-qemu" \ + mender-image-tests \ ${pytest_extra_args} exitcode=$? @@ -151,16 +151,11 @@ run_tests() { } get_pytest_files() { - wget -N ${MENDER_ACCEPTANCE_URL}/pytest.ini -P $WORKSPACE/mender-image-tests - wget -N ${MENDER_ACCEPTANCE_URL}/common.py -P $WORKSPACE/mender-image-tests - wget -N ${MENDER_ACCEPTANCE_URL}/helpers.py -P $WORKSPACE/mender-image-tests - wget -N ${MENDER_ACCEPTANCE_URL}/conftest.py -P $WORKSPACE/mender-image-tests - wget -N ${MENDER_ACCEPTANCE_URL}/fixtures.py -P $WORKSPACE/mender-image-tests - mkdir -p $WORKSPACE/mender-image-tests/files - wget -N ${MENDER_ACCEPTANCE_URL}/files/test-private-EC.pem -P $WORKSPACE/mender-image-tests/files - wget -N ${MENDER_ACCEPTANCE_URL}/files/test-private-RSA.pem -P $WORKSPACE/mender-image-tests/files - wget -N ${MENDER_ACCEPTANCE_URL}/files/test-public-EC.pem -P $WORKSPACE/mender-image-tests/files - wget -N ${MENDER_ACCEPTANCE_URL}/files/test-public-RSA.pem -P $WORKSPACE/mender-image-tests/files + mkdir -p ${WORKSPACE}/files + wget -N ${MENDER_ACCEPTANCE_URL}/files/test-private-EC.pem -P ${WORKSPACE}/files + wget -N ${MENDER_ACCEPTANCE_URL}/files/test-private-RSA.pem -P ${WORKSPACE}/files + wget -N ${MENDER_ACCEPTANCE_URL}/files/test-public-EC.pem -P ${WORKSPACE}/files + wget -N ${MENDER_ACCEPTANCE_URL}/files/test-public-RSA.pem -P ${WORKSPACE}/files } prepare_ssh_keys() { diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..74beb42 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,10 @@ +import os +import pytest +import sys + +sys.path.append( + os.path.join(os.path.dirname(__file__), "mender-image-tests", "tests") +) + +# Load the parser for our custom option flags +pytest_plugins = "utils.parseropts.parseropts" diff --git a/tests/mender-image-tests b/tests/mender-image-tests index 4a37a9c..986bd6e 160000 --- a/tests/mender-image-tests +++ b/tests/mender-image-tests @@ -1 +1 @@ -Subproject commit 4a37a9c62109f27309c5743a9850d7d1047ed400 +Subproject commit 986bd6e3e932af1432ca74f4f9f0ec5a85ed7e66 diff --git a/tests/pytest.ini b/tests/pytest.ini new file mode 100644 index 0000000..b041d45 --- /dev/null +++ b/tests/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --capture=no \ No newline at end of file