Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove image-info and use it from osbuild #4543

Merged
merged 5 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions Schutzfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"fedora-40": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
},
"repos": [
Expand Down Expand Up @@ -88,56 +88,56 @@
"rhel-8.4": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
}
},
"rhel-8.8": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
}
},
"rhel-8.9": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
}
},
"rhel-8.10": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
}
},
"rhel-9.2": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
}
},
"rhel-9.3": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
}
},
"rhel-9.4": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
}
},
"rhel-9.5": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
},
"repos": [
Expand Down Expand Up @@ -183,7 +183,7 @@
"rhel-9.6": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
},
"repos": [
Expand Down Expand Up @@ -229,7 +229,7 @@
"rhel-10.0": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
},
"repos": [
Expand Down Expand Up @@ -275,14 +275,14 @@
"centos-9": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
}
},
"centos-stream-9": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
},
"repos": [
Expand Down Expand Up @@ -328,14 +328,14 @@
"centos-10": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
}
},
"centos-stream-10": {
"dependencies": {
"osbuild": {
"commit": "9b66ad812380847557aa9911efd7af2d57ad8084"
"commit": "fcb93bde01d4a027c67b5747c8f976ceb4fc8d80"
}
},
"repos": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/osbuild-image-tests/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}
Expand All @@ -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",
Expand Down
1 change: 0 additions & 1 deletion osbuild-composer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ install -m 0755 -vp tools/define-compose-url.sh %{buildroot}%
install -m 0755 -vp tools/provision.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/gen-certs.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/gen-ssh.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/image-info %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/run-koji-container.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/koji-compose.py %{buildroot}%{_libexecdir}/osbuild-composer-test/
install -m 0755 -vp tools/libvirt_test.sh %{buildroot}%{_libexecdir}/osbuild-composer-test/
Expand Down
3 changes: 3 additions & 0 deletions schutzbot/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ retry sudo dnf -y upgrade selinux-policy
# Note: installing only -tests to catch missing dependencies
retry sudo dnf -y install "${PROJECT}-tests"

# Note: image-info is now part of osbuild-tools
retry sudo dnf -y install osbuild-tools

# Save osbuild-composer NVR to a file to be used as CI artifact
rpm -q osbuild-composer > COMPOSER_NVR

Expand Down
2 changes: 1 addition & 1 deletion test/cases/api/common/s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/cases/container-embedding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
6 changes: 1 addition & 5 deletions test/cases/filesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions test/cases/image_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 3 additions & 4 deletions test/cases/regression-old-worker-new-composer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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"

Expand All @@ -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"
Expand Down
Loading
Loading