Skip to content

Commit

Permalink
Merge pull request #6 from rh-openjdk/new_tar_check_tc
Browse files Browse the repository at this point in the history
Added testcase to check if tar is installed in the container image.
  • Loading branch information
sefroberg authored Mar 11, 2024
2 parents 600c494 + 86b3681 commit 2b0ddbf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
21 changes: 21 additions & 0 deletions containersQa/120_testTarInstalled.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -ex
set -o pipefail

## resolve folder of this script, following all symlinks,
## http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
SCRIPT_SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SCRIPT_SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
SCRIPT_DIR="$( cd -P "$( dirname "$SCRIPT_SOURCE" )" && pwd )"
SCRIPT_SOURCE="$(readlink "$SCRIPT_SOURCE")"
# if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
[[ $SCRIPT_SOURCE != /* ]] && SCRIPT_SOURCE="$SCRIPT_DIR/$SCRIPT_SOURCE"
done
readonly SCRIPT_DIR="$( cd -P "$( dirname "$SCRIPT_SOURCE" )" && pwd )"

source $SCRIPT_DIR/testlib.bash

parseArguments "$@"
processArguments
setup
testTarIsInstalled 2>&1| tee $REPORT_FILE # then check the 8 or 11 in it against some NVR
5 changes: 5 additions & 0 deletions containersQa/testlib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,11 @@ function checkOtherUserWorks() {
test -z "$OUTPUT"
}

# This test is added to check that tar is installed in all Openjdk images.
# https://issues.redhat.com/browse/OPENJDK-2588
function testTarIsInstalled() {
runOnBaseDir tar --version
}
# SECTION FOR BUILDING CONTAINER IMAGES FOR TEST.
# Ultimately these may be broken out to seperate file.

Expand Down

0 comments on commit 2b0ddbf

Please sign in to comment.