@@ -12,7 +12,7 @@ use oci_spec::image as oci_image;
1212use ocidir:: oci_spec:: distribution:: Reference ;
1313use ocidir:: oci_spec:: image:: { Arch , DigestAlgorithm } ;
1414use ostree_ext:: chunking:: ObjectMetaSized ;
15- use ostree_ext:: container:: { store, ManifestDiff } ;
15+ use ostree_ext:: container:: { store, ManifestDiff , OSTREE_COMMIT_LABEL } ;
1616use ostree_ext:: container:: {
1717 Config , ExportOpts , ImageReference , OstreeImageReference , SignatureSource , Transport ,
1818} ;
@@ -968,6 +968,7 @@ async fn test_container_chunked() -> Result<()> {
968968 let mut fixture = Fixture :: new_v1 ( ) ?;
969969
970970 let ( imgref, expected_digest) = fixture. export_container ( ) . await . unwrap ( ) ;
971+ let exported_commit = fixture. srcrepo ( ) . require_rev ( fixture. testref ( ) ) ?;
971972 let imgref = OstreeImageReference {
972973 sigverify : SignatureSource :: ContainerPolicyAllowInsecure ,
973974 imgref,
@@ -990,7 +991,12 @@ async fn test_container_chunked() -> Result<()> {
990991 store:: PrepareResult :: AlreadyPresent ( _) => panic ! ( "should not be already imported" ) ,
991992 store:: PrepareResult :: Ready ( r) => r,
992993 } ;
994+ let labels = prep. config . labels_of_config ( ) . unwrap ( ) ;
993995 assert ! ( prep. deprecated_warning( ) . is_none( ) ) ;
996+ assert_eq ! (
997+ labels. get( OSTREE_COMMIT_LABEL ) . unwrap( ) ,
998+ exported_commit. as_str( )
999+ ) ;
9941000 assert_eq ! ( prep. version( ) , Some ( "42.0" ) ) ;
9951001 let digest = prep. manifest_digest . clone ( ) ;
9961002 assert ! ( prep. ostree_commit_layer. as_ref( ) . unwrap( ) . commit. is_none( ) ) ;
@@ -1023,6 +1029,14 @@ async fn test_container_chunked() -> Result<()> {
10231029 }
10241030 let import = imp. import ( prep) . await . context ( "Init pull derived" ) . unwrap ( ) ;
10251031 assert_eq ! ( import. manifest_digest, digest) ;
1032+ // For now we never expect that these are the same
1033+ assert_ne ! ( import. get_commit( ) , exported_commit. as_str( ) ) ;
1034+ // But the parent should match
1035+ let commit_obj = fixture. destrepo ( ) . load_commit ( import. get_commit ( ) ) ?. 0 ;
1036+ assert_eq ! (
1037+ ostree:: commit_get_parent( & commit_obj) . unwrap( ) ,
1038+ exported_commit. as_str( )
1039+ ) ;
10261040
10271041 assert_eq ! ( store:: list_images( fixture. destrepo( ) ) . unwrap( ) . len( ) , 1 ) ;
10281042
0 commit comments