File tree Expand file tree Collapse file tree
tmt/tests/booted/readonly Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,8 +31,10 @@ pub(crate) struct InstallAleph {
3131 #[ serde( skip_serializing_if = "BTreeMap::is_empty" ) ]
3232 pub ( crate ) labels : BTreeMap < String , String > ,
3333 /// The version number
34+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
3435 pub ( crate ) version : Option < String > ,
3536 /// The timestamp
37+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
3638 pub ( crate ) timestamp : Option < chrono:: DateTime < chrono:: Utc > > ,
3739 /// The `uname -r` of the kernel doing the installation
3840 pub ( crate ) kernel : String ,
Original file line number Diff line number Diff line change @@ -71,6 +71,24 @@ if $is_composefs {
7171 let bootc_label = $labels | get " containers.bootc"
7272 assert ($bootc_label | is-not-empty ) " containers.bootc label should be present"
7373 }
74+
75+ # The version field is optional (skip_serializing_if = Option::is_none),
76+ # but if present it should match the booted image's version.
77+ let version = $aleph.version ? | default null
78+ if $version != null {
79+ assert ($version | is-not-empty ) " version field, if present, should be non-empty"
80+ let booted_version = $booted.image.version
81+ assert equal $version $booted_version " version should match the booted image's version"
82+ }
83+
84+ # The timestamp field may be absent if empty (skip_serializing_if), but if
85+ # present it should match the booted image's timestamp.
86+ let timestamp = $aleph.timestamp ? | default null
87+ if $timestamp != null {
88+ assert ($timestamp | is-not-empty ) " timestamp field, if present, should be non-empty"
89+ let booted_timestamp = $booted.image.timestamp
90+ assert equal $timestamp $booted_timestamp " timestamp should match the booted image's timestamp"
91+ }
7492}
7593
7694tap ok
You can’t perform that action at this time.
0 commit comments