@@ -1004,6 +1004,7 @@ public void EndToEndMultiArch_RemoteRegistry()
1004
1004
string imageX64 = $ "{ imageName } :{ imageTag } -linux-x64";
1005
1005
string imageArm64 = $ "{ imageName } :{ imageTag } -linux-arm64";
1006
1006
string imageIndex = $ "{ imageName } :{ imageTag } ";
1007
+ string imageFromRegistry = $ "{ registry } /{ imageIndex } ";
1007
1008
1008
1009
// Create a new console project
1009
1010
DirectoryInfo newProjectDir = CreateNewProject ( "console" ) ;
@@ -1031,59 +1032,42 @@ public void EndToEndMultiArch_RemoteRegistry()
1031
1032
. And . HaveStdOutContaining ( $ "Pushed image '{ imageX64 } ' to registry '{ registry } '.")
1032
1033
. And . HaveStdOutContaining ( $ "Pushed image '{ imageArm64 } ' to registry '{ registry } '.")
1033
1034
. And . HaveStdOutContaining ( $ "Pushed image index '{ imageIndex } ' to registry '{ registry } '.") ;
1034
-
1035
-
1036
- // Check that the containers can be run
1037
- // First pull the image from the registry, then tag so the image won't be overwritten
1038
- string imageX64Tagged = $ "{ registry } /test-image-{ imageName } -x64";
1035
+
1036
+ // First pull the image from the registry for each platform
1039
1037
ContainerCli . PullCommand (
1040
1038
_testOutput ,
1041
1039
"--platform" ,
1042
1040
"linux/amd64" ,
1043
- $ " { registry } / { imageIndex } " )
1041
+ imageFromRegistry )
1044
1042
. Execute ( )
1045
1043
. Should ( ) . Pass ( ) ;
1046
- ContainerCli . TagCommand (
1044
+ ContainerCli . PullCommand (
1047
1045
_testOutput ,
1048
- $ "{ registry } /{ imageIndex } ",
1049
- imageX64Tagged )
1046
+ "--platform" ,
1047
+ "linux/arm64" ,
1048
+ imageFromRegistry )
1050
1049
. Execute ( )
1051
1050
. Should ( ) . Pass ( ) ;
1052
- CommandResult processResultX64 = ContainerCli . RunCommand (
1051
+
1052
+ // Check that the containers can be run
1053
+ ContainerCli . RunCommand (
1053
1054
_testOutput ,
1054
1055
"--rm" ,
1055
1056
"--platform" ,
1056
1057
"linux/amd64" ,
1057
1058
"--name" ,
1058
1059
$ "test-container-{ imageName } -x64",
1059
- imageX64Tagged )
1060
- . Execute ( ) ;
1061
- processResultX64 . Should ( ) . Pass ( ) . And . HaveStdOut ( "Hello, World!" ) ;
1062
-
1063
- string imageArm64Tagged = $ "{ registry } /test-image-{ imageName } -arm64";
1064
- ContainerCli . PullCommand (
1065
- _testOutput ,
1066
- "--platform" ,
1067
- "linux/arm64" ,
1068
- $ "{ registry } /{ imageIndex } ")
1069
- . Execute ( )
1070
- . Should ( ) . Pass ( ) ;
1071
- ContainerCli . TagCommand (
1072
- _testOutput ,
1073
- $ "{ registry } /{ imageIndex } ",
1074
- imageArm64Tagged )
1075
- . Execute ( )
1076
- . Should ( ) . Pass ( ) ;
1077
- CommandResult processResultArm64 = ContainerCli . RunCommand (
1060
+ imageFromRegistry )
1061
+ . Execute ( ) . Should ( ) . Pass ( ) . And . HaveStdOut ( "Hello, World!" ) ;
1062
+ ContainerCli . RunCommand (
1078
1063
_testOutput ,
1079
1064
"--rm" ,
1080
1065
"--platform" ,
1081
1066
"linux/arm64" ,
1082
1067
"--name" ,
1083
1068
$ "test-container-{ imageName } -arm64",
1084
- imageArm64Tagged )
1085
- . Execute ( ) ;
1086
- processResultArm64 . Should ( ) . Pass ( ) . And . HaveStdOut ( "Hello, World!" ) ;
1069
+ imageFromRegistry )
1070
+ . Execute ( ) . Should ( ) . Pass ( ) . And . HaveStdOut ( "Hello, World!" ) ;
1087
1071
1088
1072
// Cleanup
1089
1073
newProjectDir . Delete ( true ) ;
0 commit comments