File tree Expand file tree Collapse file tree 7 files changed +70
-1
lines changed Expand file tree Collapse file tree 7 files changed +70
-1
lines changed Original file line number Diff line number Diff line change 56
56
run : sudo apt update && sudo apt install just
57
57
- uses : actions/checkout@v4
58
58
- name : Build and run container integration tests
59
- run : sudo just run-container-integration
59
+ run : sudo just run-container-integration run-container-external-tests
60
60
cargo-deny :
61
61
runs-on : ubuntu-latest
62
62
steps :
Original file line number Diff line number Diff line change @@ -10,5 +10,9 @@ build-integration-test-image *ARGS: build
10
10
run-container-integration : build-integration-test-image
11
11
podman run --rm localhost/ bootc-integration bootc-integration-tests container
12
12
13
+ # These tests may spawn their own container images.
14
+ run-container-external-tests :
15
+ ./ tests/ container/ run localhost/ bootc
16
+
13
17
unittest * ARGS :
14
18
podman build --jobs=4 --target units -t localhost/ bootc-units --build-arg=unitargs={{ ARGS}} .
Original file line number Diff line number Diff line change @@ -472,6 +472,9 @@ pub(crate) enum InternalsOpts {
472
472
// The stateroot
473
473
stateroot : String ,
474
474
} ,
475
+ /// Initiate a reboot the same way we would after --apply; intended
476
+ /// primarily for testing.
477
+ Reboot ,
475
478
#[ cfg( feature = "rhsm" ) ]
476
479
/// Publish subscription-manager facts to /etc/rhsm/facts/bootc.facts
477
480
PublishRhsmFacts ,
@@ -1230,6 +1233,7 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
1230
1233
Ok ( ( ) )
1231
1234
}
1232
1235
} ,
1236
+ InternalsOpts :: Reboot => crate :: reboot:: reboot ( ) ,
1233
1237
InternalsOpts :: Fsck => {
1234
1238
let sysroot = & get_storage ( ) . await ?;
1235
1239
crate :: fsck:: fsck ( & sysroot, std:: io:: stdout ( ) . lock ( ) ) . await ?;
Original file line number Diff line number Diff line change
1
+ [Unit]
2
+ ConditionPathExists =!/etc/initrd-release
3
+ After =local-fs.target
4
+ RequiresMountsFor =/run/bootc-test-reboot
5
+ Before =bootc-test-reboot.service
6
+ PartOf =bootc-test-reboot.service
7
+
8
+ [Service]
9
+ Type =oneshot
10
+ RemainAfterExit =yes
11
+ ExecStop =touch /run/bootc-test-reboot/success
Original file line number Diff line number Diff line change
1
+ [Unit]
2
+ ConditionPathExists =!/etc/initrd-release
3
+ Requires =bootc-finish-test-reboot.service
4
+ After =bootc-finish-test-reboot.service
5
+
6
+ [Service]
7
+ Type =oneshot
8
+ RemainAfterExit =yes
9
+ ExecStart =bootc internals reboot
10
+
11
+ [Install]
12
+ WantedBy =multi-user.target
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Verify that invoking `bootc internals reboot` actually invokes a reboot, when
3
+ # running inside systemd.
4
+ # xref:
5
+ # - https://github.com/bootc-dev/bootc/issues/1416
6
+ # - https://github.com/bootc-dev/bootc/issues/1419
7
+ set -euo pipefail
8
+ image=$1
9
+ tmpd=$( mktemp -d)
10
+ log () {
11
+ echo " $@ "
12
+ " $@ "
13
+ }
14
+ log timeout 120 podman run --rm --systemd=always --privileged -v /sys:/sys:ro --label bootc.test=reboot --net=none -v $( pwd) :/src:ro -v $tmpd :/run/bootc-test-reboot $image /bin/sh -c ' cp /src/*.service /etc/systemd/system && systemctl enable bootc-test-reboot && exec /sbin/init' || true
15
+ ls -al $tmpd
16
+ if test ' !' -f $tmpd /success; then
17
+ echo " reboot failed" 1>&2
18
+ rm -rf " $tmpd "
19
+ exit 1
20
+ fi
21
+ rm -rf " $tmpd "
22
+ echo " ok reboot"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -euo pipefail
3
+ image=$1
4
+ shift
5
+
6
+ cd $( dirname $0 )
7
+
8
+ tests=$( find . -maxdepth 1 -type d)
9
+ for case in $tests ; do
10
+ if test $case = . ; then continue ; fi
11
+ echo " Running: $case "
12
+ cd $case
13
+ ./run $image
14
+ cd -
15
+ echo " ok $case "
16
+ done
You can’t perform that action at this time.
0 commit comments