@@ -54,7 +54,7 @@ fn generate_test_repo(dir: &Utf8Path) -> Result<Utf8PathBuf> {
54
54
indoc! { "
55
55
cd {dir}
56
56
ostree --repo=repo init --mode=archive
57
- ostree --repo=repo commit -b {testref} --bootable --no-bindings --add-metadata-string=version=42.0 --add-metadata-string=buildsys.checksum=41af286dc0b172ed2f1ca934fd2278de4a1192302ffa07087cea2682e7d372e3 --gpg-homedir={gpghome} --gpg-sign={keyid} \
57
+ ostree --repo=repo commit -b {testref} --bootable --no-bindings --add-metadata=ostree.container-cmd='[ \" /usr/bin/bash \" ]' --add-metadata -string=version=42.0 --add-metadata-string=buildsys.checksum=41af286dc0b172ed2f1ca934fd2278de4a1192302ffa07087cea2682e7d372e3 --gpg-homedir={gpghome} --gpg-sign={keyid} \
58
58
--add-detached-metadata-string=my-detached-key=my-detached-value --tree=tar=exampleos.tar.zst >/dev/null
59
59
ostree --repo=repo show {testref} >/dev/null
60
60
" } ,
@@ -442,6 +442,14 @@ fn skopeo_inspect(imgref: &str) -> Result<String> {
442
442
Ok ( String :: from_utf8 ( out. stdout ) ?)
443
443
}
444
444
445
+ fn skopeo_inspect_config ( imgref : & str ) -> Result < oci_spec:: image:: ImageConfiguration > {
446
+ let out = Command :: new ( "skopeo" )
447
+ . args ( & [ "inspect" , "--config" , imgref] )
448
+ . stdout ( std:: process:: Stdio :: piped ( ) )
449
+ . output ( ) ?;
450
+ Ok ( serde_json:: from_slice ( & out. stdout ) ?)
451
+ }
452
+
445
453
#[ tokio:: test]
446
454
async fn test_container_import_export ( ) -> Result < ( ) > {
447
455
let fixture = Fixture :: new ( ) ?;
@@ -462,7 +470,7 @@ async fn test_container_import_export() -> Result<()> {
462
470
. map ( |( k, v) | ( k. to_string ( ) , v. to_string ( ) ) )
463
471
. collect ( ) ,
464
472
) ,
465
- cmd : Some ( vec ! [ "/bin/bash" . to_string ( ) ] ) ,
473
+ .. Default :: default ( )
466
474
} ;
467
475
let opts = ostree_ext:: container:: ExportOpts {
468
476
copy_meta_keys : vec ! [ "buildsys.checksum" . to_string( ) ] ,
@@ -486,6 +494,20 @@ async fn test_container_import_export() -> Result<()> {
486
494
assert ! ( inspect. contains(
487
495
r#""buildsys.checksum": "41af286dc0b172ed2f1ca934fd2278de4a1192302ffa07087cea2682e7d372e3""#
488
496
) ) ;
497
+ let cfg = skopeo_inspect_config ( & srcoci_imgref. to_string ( ) ) ?;
498
+ assert_eq ! (
499
+ cfg. config( )
500
+ . as_ref( )
501
+ . unwrap( )
502
+ . cmd( )
503
+ . as_ref( )
504
+ . unwrap( )
505
+ . get( 0 )
506
+ . as_ref( )
507
+ . unwrap( )
508
+ . as_str( ) ,
509
+ "/usr/bin/bash"
510
+ ) ;
489
511
490
512
let srcoci_unverified = OstreeImageReference {
491
513
sigverify : SignatureSource :: ContainerPolicyAllowInsecure ,
0 commit comments