@@ -1984,17 +1984,21 @@ fn unknown_config_media_type_rejected() {
19841984}
19851985
19861986#[ test]
1987- fn config_v1_rejected ( ) {
1988- let ( _dir, path) = save_for_mutation ( ) ;
1989- rewrite_manifest ( & path, |m| {
1990- m[ "config" ] [ "mediaType" ] =
1991- Value :: from ( "application/vnd.hyperlight.snapshot.config.v1+json" ) ;
1992- } ) ;
1993- let err = unwrap_err_snapshot ( Snapshot :: checked_load (
1994- & path,
1995- OciTag :: new ( "latest" ) . unwrap ( ) ,
1996- ) ) ;
1997- assert_err_contains ( err, "incompatible with snapshot ABI 4" ) ;
1987+ fn legacy_config_versions_rejected ( ) {
1988+ for media_type in [
1989+ "application/vnd.hyperlight.snapshot.config.v1+json" ,
1990+ "application/vnd.hyperlight.snapshot.config.v2+json" ,
1991+ ] {
1992+ let ( _dir, path) = save_for_mutation ( ) ;
1993+ rewrite_manifest ( & path, |m| {
1994+ m[ "config" ] [ "mediaType" ] = Value :: from ( media_type) ;
1995+ } ) ;
1996+ let err = unwrap_err_snapshot ( Snapshot :: checked_load (
1997+ & path,
1998+ OciTag :: new ( "latest" ) . unwrap ( ) ,
1999+ ) ) ;
2000+ assert_err_contains ( err, "incompatible with snapshot ABI 5" ) ;
2001+ }
19982002}
19992003
20002004#[ test]
@@ -2500,7 +2504,7 @@ fn manifest_uses_correct_config_and_layer_media_types() {
25002504 serde_json:: from_slice ( & std:: fs:: read ( manifest_path ( & path) ) . unwrap ( ) ) . unwrap ( ) ;
25012505 assert_eq ! (
25022506 manifest[ "config" ] [ "mediaType" ] . as_str( ) . unwrap( ) ,
2503- "application/vnd.hyperlight.snapshot.config.v2 +json"
2507+ "application/vnd.hyperlight.snapshot.config.v3 +json"
25042508 ) ;
25052509 assert_eq ! ( manifest[ "layers" ] . as_array( ) . unwrap( ) . len( ) , 2 ) ;
25062510 assert_eq ! (
@@ -2516,7 +2520,7 @@ fn manifest_uses_correct_config_and_layer_media_types() {
25162520 // that falls back to `config.mediaType` sees the same value.
25172521 assert_eq ! (
25182522 manifest[ "artifactType" ] . as_str( ) . unwrap( ) ,
2519- "application/vnd.hyperlight.snapshot.config.v2 +json"
2523+ "application/vnd.hyperlight.snapshot.config.v3 +json"
25202524 ) ;
25212525}
25222526
0 commit comments