@@ -12,7 +12,7 @@ use oci_spec::image as oci_image;
12
12
use ocidir:: oci_spec:: distribution:: Reference ;
13
13
use ocidir:: oci_spec:: image:: { Arch , DigestAlgorithm } ;
14
14
use ostree_ext:: chunking:: ObjectMetaSized ;
15
- use ostree_ext:: container:: { store, ManifestDiff } ;
15
+ use ostree_ext:: container:: { store, ManifestDiff , OSTREE_COMMIT_LABEL } ;
16
16
use ostree_ext:: container:: {
17
17
Config , ExportOpts , ImageReference , OstreeImageReference , SignatureSource , Transport ,
18
18
} ;
@@ -968,6 +968,7 @@ async fn test_container_chunked() -> Result<()> {
968
968
let mut fixture = Fixture :: new_v1 ( ) ?;
969
969
970
970
let ( imgref, expected_digest) = fixture. export_container ( ) . await . unwrap ( ) ;
971
+ let exported_commit = fixture. srcrepo ( ) . require_rev ( fixture. testref ( ) ) ?;
971
972
let imgref = OstreeImageReference {
972
973
sigverify : SignatureSource :: ContainerPolicyAllowInsecure ,
973
974
imgref,
@@ -990,7 +991,12 @@ async fn test_container_chunked() -> Result<()> {
990
991
store:: PrepareResult :: AlreadyPresent ( _) => panic ! ( "should not be already imported" ) ,
991
992
store:: PrepareResult :: Ready ( r) => r,
992
993
} ;
994
+ let labels = prep. config . labels_of_config ( ) . unwrap ( ) ;
993
995
assert ! ( prep. deprecated_warning( ) . is_none( ) ) ;
996
+ assert_eq ! (
997
+ labels. get( OSTREE_COMMIT_LABEL ) . unwrap( ) ,
998
+ exported_commit. as_str( )
999
+ ) ;
994
1000
assert_eq ! ( prep. version( ) , Some ( "42.0" ) ) ;
995
1001
let digest = prep. manifest_digest . clone ( ) ;
996
1002
assert ! ( prep. ostree_commit_layer. as_ref( ) . unwrap( ) . commit. is_none( ) ) ;
@@ -1023,6 +1029,14 @@ async fn test_container_chunked() -> Result<()> {
1023
1029
}
1024
1030
let import = imp. import ( prep) . await . context ( "Init pull derived" ) . unwrap ( ) ;
1025
1031
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
+ ) ;
1026
1040
1027
1041
assert_eq ! ( store:: list_images( fixture. destrepo( ) ) . unwrap( ) . len( ) , 1 ) ;
1028
1042
0 commit comments