@@ -41,16 +41,8 @@ def first_boot [] {
4141 bootc switch -- transport containers-storage localhost/bootc-first
4242
4343 # Find the large file's verity and save it
44- # nu has its own built in find which sucks, so we use the other one
45- # TODO: Replace this with some concrete API
46- # See: https://github.com/composefs/composefs-rs/pull/236
47- let file_path = (
48- /usr/bin/find /sysroot/composefs/objects -type f - size 1337k - newermt ($current_time | format date " %Y-%m-%d %H:%M:%S" )
49- | xargs grep - lx " large-file-marker"
50- )
51-
52- echo $file_path | save /var/large-file-marker-objpath
53- cat /var/large-file-marker-objpath
44+ let path = bootc internals cfs dump-files $st.status.booted.composefs.verity /usr/share/large-test-file -- backing-path-only | awk ' {print $2}'
45+ echo $" /sysroot/composefs/objects/($path )" | save /var/large-file-marker-objpath
5446
5547 echo $st.status.booted.composefs.verity | save /var/boot0-verity
5648
@@ -68,7 +60,7 @@ def second_boot [] {
6860 echo $st.status.booted.composefs.verity | save /var/boot1-verity
6961
7062 let path = cat /var/large-file-marker-objpath
71-
63+ print $path
7264 assert ($path | path exists )
7365
7466 mut containerfile = echo "
@@ -90,7 +82,7 @@ def third_boot [] {
9082 mount /dev/disk/by-partlabel/EFI-SYSTEM /var/tmp/efi
9183
9284 assert equal $booted.image.image " localhost/bootc-second"
93- assert ($" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot0-verity ).efi" | path exists )
85+ assert (not ( $" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot0-verity ).efi" | path exists ) )
9486 assert ($" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot1-verity ).efi" | path exists )
9587
9688 echo $st.status.booted.composefs.verity | save /var/boot2-verity
@@ -119,8 +111,7 @@ def fourth_boot [] {
119111 mount /dev/disk/by-partlabel/EFI-SYSTEM /var/tmp/efi
120112
121113 assert equal $booted.image.image " localhost/bootc-third"
122- assert (not ($" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot0-verity ).efi" | path exists ))
123- assert ($" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot1-verity ).efi" | path exists )
114+ assert (not ($" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot1-verity ).efi" | path exists ))
124115 assert ($" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot2-verity ).efi" | path exists )
125116
126117 echo $st.status.booted.composefs.verity | save /var/boot3-verity
@@ -138,29 +129,12 @@ def fourth_boot [] {
138129 tap ok
139130}
140131
141- def fifth_boot [] {
142- mkdir /var/tmp/efi
143- mount /dev/disk/by-partlabel/EFI-SYSTEM /var/tmp/efi
144-
145- assert equal $booted.image.image " localhost/bootc-final"
146-
147- assert (not ($" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot1-verity ).efi" | path exists ))
148- assert ($" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot2-verity ).efi" | path exists )
149- assert ($" /var/tmp/efi/EFI/Linux/bootc/($uki_prefix )(cat /var/boot3-verity ).efi" | path exists )
150-
151- # We had this in boot1 (second boot)
152- let path = cat /var/large-file-marker-objpath
153- assert (not ($path | path exists ))
154- tap ok
155- }
156-
157132def main [] {
158133 match $env .TMT_REBOOT_COUNT ? {
159134 null | " 0" => first_boot ,
160135 " 1" => second_boot ,
161136 " 2" => third_boot ,
162137 " 3" => fourth_boot ,
163- " 4" => fifth_boot ,
164138 $o => { error make { msg : $" Invalid TMT_REBOOT_COUNT ($o )" } },
165139 }
166140}
0 commit comments