From Fedora Project Wiki
< User:Roshi | QA/AtomicTests
Description
This testcase ensures it's possible to rollback an Atomic Host.
Setup
- Ensure you have a booted working Atomic Host you've upgraded at least once.
How to test
- Check to make sure you're on an upgraded host.
# rpm-ostree status State: idle; auto updates disabled Deployments: ● ostree://fedora-atomic:fedora/28/x86_64/atomic-host Version: 28.20180409.n.0 (2018-04-09 12:54:10) Commit: fe48516d3dc74dead8319521b4f3cddce21d940b42211c6c72ba8f66b0dca8f5 GPGSignature: Valid signature by 128CF232A9371991C8A65695E08E7E629DB62FB1 ostree://fedora-atomic:fedora/28/x86_64/atomic-host Version: 28_Beta.1.3 (2018-03-28 22:24:38) Commit: ba6371389226223fb8ba055fb02b92febf4d00e1ccd435cc21cba6af19088c73 GPGSignature: Valid signature by 128CF232A9371991C8A65695E08E7E629DB62FB1
- As a privileged user (i.e. 'root'), write hash to a file
# cat /ostree/repo/refs/heads/ostree/1/1/0 fe48516d3dc74dead8319521b4f3cddce21d940b42211c6c72ba8f66b0dca8f5 # cat /ostree/repo/refs/heads/ostree/1/1/0 > /etc/file2
- Roll the host back
# rpm-ostree rollback Moving 'ba6371389226223fb8ba055fb02b92febf4d00e1ccd435cc21cba6af19088c73.0' to be first deployment Transaction complete; bootconfig swap: yes deployment count change: 0 Downgraded: GeoIP-GeoLite-data 2018.04-1.fc28 -> 2018.02-1.fc28 NetworkManager 1:1.10.6-1.fc28 -> 1:1.10.4-1.fc28 NetworkManager-libnm 1:1.10.6-1.fc28 -> 1:1.10.4-1.fc28 NetworkManager-team 1:1.10.6-1.fc28 -> 1:1.10.4-1.fc28 audit 2.8.3-2.fc28 -> 2.8.2-4.fc28 audit-libs 2.8.3-2.fc28 -> 2.8.2-4.fc28 audit-libs-python2 2.8.3-2.fc28 -> 2.8.2-4.fc28 audit-libs-python3 2.8.3-2.fc28 -> 2.8.2-4.fc28 bash 4.4.19-2.fc28 -> 4.4.19-1.fc28 bash-completion 1:2.7-4.fc28 -> 1:2.7-3.fc28 bind-export-libs 32:9.11.3-5.fc28 -> 32:9.11.3-2.b1.fc28 checkpolicy 2.7-7.fc28 -> 2.7-5.fc28 chrony 3.3-1.fc28 -> 3.2-4.fc28 cockpit-bridge 164-1.fc28 -> 161-2.fc28 cockpit-docker 164-1.fc28 -> 161-2.fc28 cockpit-networkmanager 164-1.fc28 -> 161-2.fc28 cockpit-ostree 164-1.fc28 -> 161-2.fc28 cockpit-system 164-1.fc28 -> 161-2.fc28 container-selinux 2:2.55-1.fc28 -> 2:2.48-1.fc28 ...
- Reboot the system
Expected Results
- Verify you are booted into the Beta deployment and upgraded deployment is staged
# rpm-ostree status State: idle; auto updates disabled Deployments: ● ostree://fedora-atomic:fedora/28/x86_64/atomic-host Version: 28_Beta.1.3 (2018-03-28 22:24:38) Commit: ba6371389226223fb8ba055fb02b92febf4d00e1ccd435cc21cba6af19088c73 GPGSignature: Valid signature by 128CF232A9371991C8A65695E08E7E629DB62FB1 ostree://fedora-atomic:fedora/28/x86_64/atomic-host Version: 28.20180409.n.0 (2018-04-09 12:54:10) Commit: fe48516d3dc74dead8319521b4f3cddce21d940b42211c6c72ba8f66b0dca8f5 GPGSignature: Valid signature by 128CF232A9371991C8A65695E08E7E629DB62FB1
- file2 should not exist and file1 should
# cat /etc/file1 ba6371389226223fb8ba055fb02b92febf4d00e1ccd435cc21cba6af19088c73 # cat /etc/file2 cat: /etc/file2: No such file or directory
- Docker containers should still run
# docker run -it --rm docker.io/busybox true && echo "PASS" || echo "FAIL" PASS