From eed168f1dab580a59c66b60e031b6ebf273712f2 Mon Sep 17 00:00:00 2001 From: Lucas Bernardes Date: Mon, 25 Nov 2024 13:12:58 -0300 Subject: [PATCH] tests/integration: Rename DEVICE_PASS to DEVICE_PASSWORD on tests AVAL already defines the device password as the variable DEVICE_PASSWORD, so the change is made to use the same standards and avoid duplication of variables with the same functionality. Signed-off-by: Lucas Bernardes --- tests/integration/functions.sh | 4 ++-- tests/integration/run.sh | 1 - tests/integration/testcases/build.bats | 2 +- tests/integration/testcases/deploy.bats | 4 ++-- tests/integration/testcases/dt.bats | 2 +- tests/integration/testcases/dto.bats | 4 ++-- .../testcases/images-download.bats | 2 +- tests/integration/testcases/isolate.bats | 22 +++++++++---------- tests/integration/testcases/union.bats | 4 ++-- tests/integration/testcases/wic/build.bats | 2 +- tests/integration/testcases/wic/deploy.bats | 4 ++-- tests/integration/testcases/wic/union.bats | 4 ++-- 12 files changed, 27 insertions(+), 28 deletions(-) diff --git a/tests/integration/functions.sh b/tests/integration/functions.sh index ba0b8dc..45c6dec 100755 --- a/tests/integration/functions.sh +++ b/tests/integration/functions.sh @@ -64,14 +64,14 @@ export -f torizoncore-builder-clean-storage # $@ = command to be executed device-shell() { local OPTS="-o ConnectTimeout=5 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" - sshpass -p $DEVICE_PASS ssh -p $DEVICE_PORT -n -q $OPTS $DEVICE_USER@$DEVICE_ADDR "$@" + sshpass -p $DEVICE_PASSWORD ssh -p $DEVICE_PORT -n -q $OPTS $DEVICE_USER@$DEVICE_ADDR "$@" } export -f device-shell # run command in the device via SSH using sudo # $@ = command to be executed with sudo device-shell-root() { - device-shell "echo $DEVICE_PASS | sudo -S $@" + device-shell "echo $DEVICE_PASSWORD | sudo -S $@" } export -f device-shell-root diff --git a/tests/integration/run.sh b/tests/integration/run.sh index 168ec03..1a95bf7 100755 --- a/tests/integration/run.sh +++ b/tests/integration/run.sh @@ -47,7 +47,6 @@ export SAMPLES_DIR=samples # device address and credentials export DEVICE_ADDR=$TCB_DEVICE export DEVICE_USER="torizon" -export DEVICE_PASS=$DEVICE_PASSWORD export WIC_MACHINES="intel-corei7-64 qemux86-64 raspberrypi4-64" diff --git a/tests/integration/testcases/build.bats b/tests/integration/testcases/build.bats index 952db26..8b64d0f 100644 --- a/tests/integration/testcases/build.bats +++ b/tests/integration/testcases/build.bats @@ -171,7 +171,7 @@ teardown_file() { # Deploy custom image. run torizoncore-builder deploy --remote-host "$DEVICE_ADDR" \ --remote-username "$DEVICE_USER" \ - --remote-password "$DEVICE_PASS" \ + --remote-password "$DEVICE_PASSWORD" \ --remote-port "$DEVICE_PORT" \ --reboot "$COMMIT" assert_success diff --git a/tests/integration/testcases/deploy.bats b/tests/integration/testcases/deploy.bats index f7d8733..bec818c 100644 --- a/tests/integration/testcases/deploy.bats +++ b/tests/integration/testcases/deploy.bats @@ -56,7 +56,7 @@ load 'lib/common.bash' run torizoncore-builder deploy --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT \ --reboot some_branch assert_failure @@ -74,7 +74,7 @@ load 'lib/common.bash' run torizoncore-builder deploy --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT \ --reboot branch1 assert_success diff --git a/tests/integration/testcases/dt.bats b/tests/integration/testcases/dt.bats index bd0422d..9cb3530 100644 --- a/tests/integration/testcases/dt.bats +++ b/tests/integration/testcases/dt.bats @@ -187,7 +187,7 @@ load 'lib/common.bash' torizoncore-builder union branch1 run torizoncore-builder deploy --remote-host "$DEVICE_ADDR" \ --remote-username "$DEVICE_USER" \ - --remote-password "$DEVICE_PASS" \ + --remote-password "$DEVICE_PASSWORD" \ --remote-port "$DEVICE_PORT" \ --reboot branch1 assert_success diff --git a/tests/integration/testcases/dto.bats b/tests/integration/testcases/dto.bats index b2fa5b1..4111f33 100644 --- a/tests/integration/testcases/dto.bats +++ b/tests/integration/testcases/dto.bats @@ -109,7 +109,7 @@ bats_load_library 'bats/bats-file/load.bash' torizoncore-builder union branch1 run torizoncore-builder deploy \ --remote-host $DEVICE_ADDR --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS --remote-port $DEVICE_PORT --reboot branch1 + --remote-password $DEVICE_PASSWORD --remote-port $DEVICE_PORT --reboot branch1 assert_success assert_output --partial "Deploying successfully finished" @@ -137,7 +137,7 @@ bats_load_library 'bats/bats-file/load.bash' torizoncore-builder union branch2 run torizoncore-builder deploy \ --remote-host $DEVICE_ADDR --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS --remote-port $DEVICE_PORT --reboot branch2 + --remote-password $DEVICE_PASSWORD --remote-port $DEVICE_PORT --reboot branch2 assert_success assert_output --partial "Deploying successfully finished" diff --git a/tests/integration/testcases/images-download.bats b/tests/integration/testcases/images-download.bats index f618ba2..5e3ee9e 100644 --- a/tests/integration/testcases/images-download.bats +++ b/tests/integration/testcases/images-download.bats @@ -26,7 +26,7 @@ load 'lib/common.bash' run torizoncore-builder images download --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT assert_success assert_output --partial "Unpacked OSTree from Toradex Easy Installer image" diff --git a/tests/integration/testcases/isolate.bats b/tests/integration/testcases/isolate.bats index d7aa8ae..af0ebaa 100644 --- a/tests/integration/testcases/isolate.bats +++ b/tests/integration/testcases/isolate.bats @@ -31,7 +31,7 @@ load 'lib/isolate.bash' run torizoncore-builder isolate --changes-directory $ISOLATE_DIR \ --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT assert_success assert_output --partial "Changes in /etc successfully isolated." @@ -61,7 +61,7 @@ load 'lib/isolate.bash' --force \ --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT assert_success assert_output --partial "Changes in /etc successfully isolated." @@ -86,7 +86,7 @@ load 'lib/isolate.bash' run torizoncore-builder isolate --changes-directory $ISOLATE_DIR \ --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT assert_failure assert_output --partial "There is already a directory with isolated changes. If you want to replace it, please use --force." @@ -112,7 +112,7 @@ load 'lib/isolate.bash' run torizoncore-builder isolate --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT assert_failure assert_output --partial "There is already a directory with isolated changes. If you want to replace it, please use --force." @@ -138,7 +138,7 @@ load 'lib/isolate.bash' run torizoncore-builder isolate --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT \ --force assert_success @@ -173,7 +173,7 @@ load 'lib/isolate.bash' --force \ --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT assert_success assert_output --partial "Changes in /etc successfully isolated." @@ -205,7 +205,7 @@ load 'lib/isolate.bash' torizoncore-builder images --remove-storage unpack $DEFAULT_TEZI_IMAGE run torizoncore-builder isolate --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT assert_success assert_output --partial "Changes in /etc successfully isolated." @@ -229,7 +229,7 @@ load 'lib/isolate.bash' torizoncore-builder images --remove-storage unpack $DEFAULT_TEZI_IMAGE run torizoncore-builder isolate --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT assert_success assert_output --partial "Changes in /etc successfully isolated." @@ -251,7 +251,7 @@ load 'lib/isolate.bash' run torizoncore-builder isolate --changes-directory $ISOLATE_DIR \ --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT assert_success assert_output --partial "Changes in /etc successfully isolated." @@ -270,7 +270,7 @@ load 'lib/isolate.bash' run torizoncore-builder isolate --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT \ --force assert_success @@ -287,7 +287,7 @@ load 'lib/isolate.bash' run torizoncore-builder isolate --changes-directory $ISOLATE_DIR \ --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT \ --force assert_success diff --git a/tests/integration/testcases/union.bats b/tests/integration/testcases/union.bats index 38629b1..dd13e95 100644 --- a/tests/integration/testcases/union.bats +++ b/tests/integration/testcases/union.bats @@ -93,7 +93,7 @@ load 'lib/union.bash' run torizoncore-builder isolate --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT make-changes-to-validate-tcattr-acls "/storage/changes" @@ -129,7 +129,7 @@ load 'lib/union.bash' --force \ --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT add-files-to-check-default-credentials "/workdir/$ISOLATE_DIR" diff --git a/tests/integration/testcases/wic/build.bats b/tests/integration/testcases/wic/build.bats index 9ed1d40..deaa7fd 100644 --- a/tests/integration/testcases/wic/build.bats +++ b/tests/integration/testcases/wic/build.bats @@ -218,7 +218,7 @@ teardown_file() { # Deploy custom image. run torizoncore-builder deploy --remote-host "$DEVICE_ADDR" \ --remote-username "$DEVICE_USER" \ - --remote-password "$DEVICE_PASS" \ + --remote-password "$DEVICE_PASSWORD" \ --remote-port "$DEVICE_PORT" \ --reboot "$COMMIT" assert_success diff --git a/tests/integration/testcases/wic/deploy.bats b/tests/integration/testcases/wic/deploy.bats index 44d167e..90425c3 100644 --- a/tests/integration/testcases/wic/deploy.bats +++ b/tests/integration/testcases/wic/deploy.bats @@ -67,7 +67,7 @@ load '../lib/common.bash' run torizoncore-builder deploy --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT \ --reboot some_branch assert_failure @@ -85,7 +85,7 @@ load '../lib/common.bash' run torizoncore-builder deploy --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT \ --reboot branch1 assert_success diff --git a/tests/integration/testcases/wic/union.bats b/tests/integration/testcases/wic/union.bats index 87ccc0c..ee14024 100644 --- a/tests/integration/testcases/wic/union.bats +++ b/tests/integration/testcases/wic/union.bats @@ -93,7 +93,7 @@ load '../lib/union.bash' run torizoncore-builder isolate --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT make-changes-to-validate-tcattr-acls "/storage/changes" @@ -129,7 +129,7 @@ load '../lib/union.bash' --force \ --remote-host $DEVICE_ADDR \ --remote-username $DEVICE_USER \ - --remote-password $DEVICE_PASS \ + --remote-password $DEVICE_PASSWORD \ --remote-port $DEVICE_PORT add-files-to-check-default-credentials "/workdir/$ISOLATE_DIR"