From 5eb8709a18930c2f2ab9489d11ec5137a33ec015 Mon Sep 17 00:00:00 2001 From: Jakub Rusz Date: Tue, 7 Dec 2021 08:14:10 +0100 Subject: [PATCH] tests: add sudo to get_metadata function With new weldr-client package the metadata tar archive created has permissions set to 600 instead of 644 which causes permission failures when interacting with it. Adding sudo to resolve that. --- test/cases/aws.sh | 6 +++--- test/cases/azure.sh | 6 +++--- test/cases/installers.sh | 6 +++--- test/cases/ostree-ng.sh | 6 +++--- test/cases/ostree-raw-image.sh | 6 +++--- test/cases/ostree-simplified-installer.sh | 6 +++--- test/cases/ostree.sh | 6 +++--- test/cases/vmware.sh | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/cases/aws.sh b/test/cases/aws.sh index 21913a983..9f2fc1120 100755 --- a/test/cases/aws.sh +++ b/test/cases/aws.sh @@ -118,11 +118,11 @@ get_compose_metadata () { # Find the tarball and extract it. TARBALL=$(basename "$(find . -maxdepth 1 -type f -name "*-metadata.tar")") - tar -xf "$TARBALL" - rm -f "$TARBALL" + sudo tar -xf "$TARBALL" + sudo rm -f "$TARBALL" # Move the JSON file into place. - cat "${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null + sudo cat "${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null } # Get the console screenshot from the AWS instance. diff --git a/test/cases/azure.sh b/test/cases/azure.sh index 563bb35ef..49cccb4b8 100755 --- a/test/cases/azure.sh +++ b/test/cases/azure.sh @@ -126,11 +126,11 @@ get_compose_metadata () { # Find the tarball and extract it. TARBALL=$(basename "$(find . -maxdepth 1 -type f -name "*-metadata.tar")") - tar -xf "$TARBALL" - rm -f "$TARBALL" + sudo tar -xf "$TARBALL" + sudo rm -f "$TARBALL" # Move the JSON file into place. - cat "${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null + sudo cat "${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null } is_weldr_client_installed () { diff --git a/test/cases/installers.sh b/test/cases/installers.sh index 7a6322adb..f6e1e71bf 100755 --- a/test/cases/installers.sh +++ b/test/cases/installers.sh @@ -150,11 +150,11 @@ get_compose_metadata () { # Find the tarball and extract it. TARBALL=$(basename "$(find . -maxdepth 1 -type f -name "*-metadata.tar")") - tar -xf "$TARBALL" -C "${TEMPDIR}" - rm -f "$TARBALL" + sudo tar -xf "$TARBALL" -C "${TEMPDIR}" + sudo rm -f "$TARBALL" # Move the JSON file into place. - jq -M '.' "${TEMPDIR}"/"${COMPOSE_ID}".json | tee "$METADATA_FILE" > /dev/null + sudo jq -M '.' "${TEMPDIR}"/"${COMPOSE_ID}".json | tee "$METADATA_FILE" > /dev/null } # Build an installer diff --git a/test/cases/ostree-ng.sh b/test/cases/ostree-ng.sh index 8e38d2d62..f717dee60 100755 --- a/test/cases/ostree-ng.sh +++ b/test/cases/ostree-ng.sh @@ -165,11 +165,11 @@ get_compose_metadata () { # Find the tarball and extract it. TARBALL=$(basename "$(find . -maxdepth 1 -type f -name "*-metadata.tar")") - tar -xf "$TARBALL" -C "${TEMPDIR}" - rm -f "$TARBALL" + sudo tar -xf "$TARBALL" -C "${TEMPDIR}" + sudo rm -f "$TARBALL" # Move the JSON file into place. - cat "${TEMPDIR}"/"${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null + sudo cat "${TEMPDIR}"/"${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null } # Build ostree image. diff --git a/test/cases/ostree-raw-image.sh b/test/cases/ostree-raw-image.sh index 0b4aae1bb..2609c0951 100755 --- a/test/cases/ostree-raw-image.sh +++ b/test/cases/ostree-raw-image.sh @@ -137,11 +137,11 @@ get_compose_metadata () { # Find the tarball and extract it. TARBALL=$(basename "$(find . -maxdepth 1 -type f -name "*-metadata.tar")") - tar -xf "$TARBALL" -C "${TEMPDIR}" - rm -f "$TARBALL" + sudo tar -xf "$TARBALL" -C "${TEMPDIR}" + sudo rm -f "$TARBALL" # Move the JSON file into place. - cat "${TEMPDIR}"/"${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null + sudo cat "${TEMPDIR}"/"${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null } # Build ostree image. diff --git a/test/cases/ostree-simplified-installer.sh b/test/cases/ostree-simplified-installer.sh index 2c0c728f0..17c6c91e4 100755 --- a/test/cases/ostree-simplified-installer.sh +++ b/test/cases/ostree-simplified-installer.sh @@ -146,11 +146,11 @@ get_compose_metadata () { # Find the tarball and extract it. TARBALL=$(basename "$(find . -maxdepth 1 -type f -name "*-metadata.tar")") - tar -xf "$TARBALL" -C "${TEMPDIR}" - rm -f "$TARBALL" + sudo tar -xf "$TARBALL" -C "${TEMPDIR}" + sudo rm -f "$TARBALL" # Move the JSON file into place. - cat "${TEMPDIR}"/"${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null + sudo cat "${TEMPDIR}"/"${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null } # Build ostree image. diff --git a/test/cases/ostree.sh b/test/cases/ostree.sh index 202e8c821..9d08eb9c3 100755 --- a/test/cases/ostree.sh +++ b/test/cases/ostree.sh @@ -163,11 +163,11 @@ get_compose_metadata () { # Find the tarball and extract it. TARBALL=$(basename "$(find . -maxdepth 1 -type f -name "*-metadata.tar")") - tar -xf "$TARBALL" -C "${TEMPDIR}" - rm -f "$TARBALL" + sudo tar -xf "$TARBALL" -C "${TEMPDIR}" + sudo rm -f "$TARBALL" # Move the JSON file into place. - cat "${TEMPDIR}"/"${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null + sudo cat "${TEMPDIR}"/"${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null } # Build ostree image. diff --git a/test/cases/vmware.sh b/test/cases/vmware.sh index 254412f6e..f1e921085 100755 --- a/test/cases/vmware.sh +++ b/test/cases/vmware.sh @@ -97,11 +97,11 @@ get_compose_metadata () { # Find the tarball and extract it. TARBALL=$(basename "$(find . -maxdepth 1 -type f -name "*-metadata.tar")") - tar -xf "$TARBALL" - rm -f "$TARBALL" + sudo tar -xf "$TARBALL" + sudo rm -f "$TARBALL" # Move the JSON file into place. - cat "${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null + sudo cat "${COMPOSE_ID}".json | jq -M '.' | tee "$METADATA_FILE" > /dev/null } # Write an VMWare TOML file