Skip to content

Commit 4504460

Browse files
authored
Merge pull request #101 from yih-redhat/make-file
ci: add make integration-test
2 parents 3b13132 + b6d2ab9 commit 4504460

4 files changed

Lines changed: 57 additions & 2 deletions

File tree

Makefile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,48 @@ rpm: $(RPM_SPECFILE) $(RPM_TARBALL)
6363
clean:
6464
cargo clean "--target-dir=${TARGETDIR}"
6565
rm -rf rpmbuild
66+
67+
# integration-test: Run the bootc image integration tests (requires QUAY credentials)
68+
#
69+
# Prerequisites:
70+
# - Must be executed on Fedora Rawhide OR CentOS Stream 10
71+
# - Requires QUAY_USERNAME and QUAY_PASSWORD environment variables
72+
#
73+
# Usage:
74+
# QUAY_USERNAME=<your_quay_username> QUAY_PASSWORD=<your_quay_pass> make integration-test
75+
.PHONY: integration-test
76+
integration-test:
77+
@# Verify required environment variables are set
78+
@if [ -z "$$QUAY_USERNAME" ]; then \
79+
echo "ERROR: QUAY_USERNAME environment variable not set"; \
80+
echo "Usage: QUAY_USERNAME=quay_user QUAY_PASSWORD=quay_pass make integration-test"; \
81+
exit 1; \
82+
fi
83+
@if [ -z "$$QUAY_PASSWORD" ]; then \
84+
echo "ERROR: QUAY_PASSWORD environment variable not set"; \
85+
echo "Usage: QUAY_USERNAME=quay_user QUAY_PASSWORD=quay_pass make integration-test"; \
86+
exit 1; \
87+
fi
88+
89+
@# Verify supported operating system
90+
@. /etc/os-release; \
91+
if [ "$$ID" = "fedora" ] && { [ "$$VERSION_ID" = "rawhide" ] || [ "$$VERSION_ID" = "43" ]; }; then \
92+
echo "Running on Fedora $$VERSION_ID"; \
93+
elif [ "$$ID" = "centos" ] && [ "$$VERSION_ID" = "10" ]; then \
94+
echo "Running on CentOS Stream $$VERSION_ID"; \
95+
else \
96+
echo "Unsupported OS: $$ID $$VERSION_ID"; \
97+
echo "This test requires Fedora Rawhide or CentOS Stream 10"; \
98+
exit 1; \
99+
fi
100+
101+
@# Run test script and report results
102+
@echo "Starting integration test"; \
103+
cd tests && ./greenboot-bootc-qcow2.sh; \
104+
TEST_EXIT=$$?; \
105+
if [ $$TEST_EXIT -eq 0 ]; then \
106+
echo "SUCCESS: Integration test passed"; \
107+
else \
108+
echo "FAILURE: Integration test failed"; \
109+
exit $$TEST_EXIT; \
110+
fi

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,15 @@ At the moment, it is possible to customize the following parameters via environm
8989
- Unsets `boot_counter` GRUB env var and sets `boot_success` GRUB env var to 1.
9090
- Runs the scripts in `green.d` folder, scripts that are meant to be run after a successful update.
9191
- Creates the MOTD with a success message.
92+
93+
## Integration Tests
94+
95+
To run integration tests:
96+
97+
1. **Requirements**:
98+
- Fedora Rawhide OR CentOS Stream 10
99+
- Quay.io account with container registry access
100+
101+
2. **Execution**:
102+
```bash
103+
QUAY_USERNAME=<your_quay_username> QUAY_PASSWORD=<your_quay_password> make integration-test

tests/greenboot-bootc-anaconda-iso.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ cp testing_assets/failing_binary tests/ && popd
164164
###########################################################
165165
greenprint "Building bootc container with greenboot installed"
166166
podman login quay.io -u ${QUAY_USERNAME} -p ${QUAY_PASSWORD}
167-
podman login registry.stage.redhat.io -u ${STAGE_REDHAT_IO_USERNAME} -p ${STAGE_REDHAT_IO_TOKEN}
168167
tee Containerfile > /dev/null << EOF
169168
FROM ${BASE_IMAGE_URL}
170169
# Copy the local RPM files into the container

tests/greenboot-bootc-qcow2.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ cp testing_assets/failing_binary tests/ && popd
164164
###########################################################
165165
greenprint "Building bootc container with greenboot installed"
166166
podman login quay.io -u ${QUAY_USERNAME} -p ${QUAY_PASSWORD}
167-
podman login registry.stage.redhat.io -u ${STAGE_REDHAT_IO_USERNAME} -p ${STAGE_REDHAT_IO_TOKEN}
168167
tee Containerfile > /dev/null << EOF
169168
FROM ${BASE_IMAGE_URL}
170169
# Copy the local RPM files into the container

0 commit comments

Comments
 (0)