test: update all calls to image-info
Call the script without a path since it's now in the PATH. Drop the SELinux labelling workaround (chcon) from filesystem.sh and image_tests.sh. The packaged tool is already labelled correctly. Install osbuild-tools instead of osbuild-composer-tests in regression-old-worker-new-composer.sh to get osbuild-image-info.
This commit is contained in:
parent
58d16f662f
commit
083d84f70c
6 changed files with 8 additions and 17 deletions
|
|
@ -21,7 +21,7 @@ func GetOsbuildCommand(store, outputDirectory string, exports []string) *exec.Cm
|
|||
|
||||
func GetImageInfoCommand(imagePath string) *exec.Cmd {
|
||||
return exec.Command(
|
||||
"/usr/libexec/osbuild-composer-test/image-info",
|
||||
"osbuild-image-info",
|
||||
imagePath,
|
||||
)
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@ var TestPaths = struct {
|
|||
MetaData string
|
||||
AzureDeploymentTemplate string
|
||||
}{
|
||||
ImageInfo: "/usr/libexec/osbuild-composer-test/image-info",
|
||||
ImageInfo: "osbuild-image-info",
|
||||
PrivateKey: "/usr/share/tests/osbuild-composer/keyring/id_rsa",
|
||||
TestCasesDirectory: "/usr/share/tests/osbuild-composer/manifests",
|
||||
UserData: "/usr/share/tests/osbuild-composer/cloud-init/user-data",
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ function verifyDisk() {
|
|||
greenprint "Verifying contents of ${filename}"
|
||||
|
||||
infofile="${filename}-info.json"
|
||||
sudo /usr/libexec/osbuild-composer-test/image-info "${filename}" | tee "${infofile}" > /dev/null
|
||||
sudo osbuild-image-info "${filename}" | tee "${infofile}" > /dev/null
|
||||
|
||||
# save image info to artifacts
|
||||
cp -v "${infofile}" "${ARTIFACTS}/image-info.json"
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ sudo composer-cli compose image "${COMPOSE_ID}" > /dev/null
|
|||
IMAGE_FILENAME="${COMPOSE_ID}-disk.qcow2"
|
||||
|
||||
greenprint "💬 Checking that image exists"
|
||||
INFO="$(sudo /usr/libexec/osbuild-composer-test/image-info "${IMAGE_FILENAME}")"
|
||||
INFO="$(sudo osbuild-image-info "${IMAGE_FILENAME}")"
|
||||
|
||||
IMAGE_ID="d4ee87dab8193afad523b1042b9d3f5ec887555a704e5aaec2876798ebb585a6"
|
||||
FEDORA_CONTAINER_EXISTS=$(jq -e --arg id "${IMAGE_ID}" 'any(."container-images" | select(. != null and .[].Id == $id); .)' <<< "${INFO}")
|
||||
|
|
|
|||
|
|
@ -36,10 +36,6 @@ function cleanup_on_exit() {
|
|||
}
|
||||
trap cleanup_on_exit EXIT
|
||||
|
||||
# Workaround the problem that 'image-info' can not read SELinux labels unknown to the host from the image
|
||||
OSBUILD_LABEL=$(matchpathcon -n "$(type -p osbuild)")
|
||||
sudo chcon "$OSBUILD_LABEL" /usr/libexec/osbuild-composer-test/image-info
|
||||
|
||||
# Build ostree image.
|
||||
build_image() {
|
||||
blueprint_file=$1
|
||||
|
|
@ -204,7 +200,7 @@ sudo composer-cli compose image "${COMPOSE_ID}" > /dev/null
|
|||
IMAGE_FILENAME="${COMPOSE_ID}-disk.qcow2"
|
||||
|
||||
greenprint "💬 Checking mountpoints"
|
||||
if ! INFO="$(sudo /usr/libexec/osbuild-composer-test/image-info "${IMAGE_FILENAME}")"; then
|
||||
if ! INFO="$(sudo osbuild-image-info "${IMAGE_FILENAME}")"; then
|
||||
echo "ERROR image-info failed, show last few kernel message to debug"
|
||||
dmesg | tail -n10
|
||||
exit 2
|
||||
|
|
|
|||
|
|
@ -96,10 +96,6 @@ run_test_case () {
|
|||
# Change to the working directory.
|
||||
cd $WORKING_DIRECTORY
|
||||
|
||||
# Workaround the problem that 'image-info' can not read SELinux labels unknown to the host from the image
|
||||
OSBUILD_LABEL=$(matchpathcon -n "$(type -p osbuild)")
|
||||
sudo chcon "$OSBUILD_LABEL" /usr/libexec/osbuild-composer-test/image-info
|
||||
|
||||
# Run each test case.
|
||||
for TEST_CASE in $(get_test_cases); do
|
||||
run_test_case "$IMAGE_TEST_CASE_RUNNER" "$TEST_CASE"
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ DESIRED_OSBUILD_COMMIT_SHA=$(curl -s "https://raw.githubusercontent.com/osbuild/
|
|||
|
||||
# Get commit hash of latest composer version, only used for verification.
|
||||
CURRENT_COMPOSER_VERSION=$(rpm -q --qf '%{version}\n' osbuild-composer)
|
||||
VERIFICATION_COMPOSER_RPM="osbuild-composer-tests-$((CURRENT_COMPOSER_VERSION - 1))"
|
||||
|
||||
COMPOSER_LATEST_TAG_SHA=$(curl -s "https://api.github.com/repos/osbuild/osbuild-composer/git/ref/tags/v$((CURRENT_COMPOSER_VERSION-1))" | jq -r '.object.sha')
|
||||
COMPOSER_LATEST_COMMIT_SHA=$(curl -s "https://api.github.com/repos/osbuild/osbuild-composer/git/tags/$COMPOSER_LATEST_TAG_SHA" | jq -r '.object.sha')
|
||||
|
|
@ -398,8 +397,8 @@ setup_repo osbuild-composer "$COMPOSER_LATEST_COMMIT_SHA" 10
|
|||
OSBUILD_GIT_COMMIT=$(cat Schutzfile | jq -r '.["'"${ID}-${VERSION_ID}"'"].dependencies.osbuild.commit')
|
||||
setup_repo osbuild "$OSBUILD_GIT_COMMIT" 10
|
||||
|
||||
greenprint "Installing osbuild-composer-tests for image-info"
|
||||
sudo dnf install -y $VERIFICATION_COMPOSER_RPM
|
||||
greenprint "Installing osbuild-tools for osbuild-image-info"
|
||||
sudo dnf install -y osbuild-tools
|
||||
|
||||
curl "${S3_URL}" --output "${WORKDIR}/disk.qcow2"
|
||||
|
||||
|
|
@ -409,7 +408,7 @@ function verifyDisk() {
|
|||
greenprint "Verifying contents of ${filename}"
|
||||
|
||||
infofile="${filename}-info.json"
|
||||
sudo /usr/libexec/osbuild-composer-test/image-info "${filename}" | tee "${infofile}" > /dev/null
|
||||
sudo osbuild-image-info "${filename}" | tee "${infofile}" > /dev/null
|
||||
|
||||
# save image info to artifacts
|
||||
cp -v "${infofile}" "${ARTIFACTS}/image-info.json"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue