Skip to content

Commit 2e6adab

Browse files
Surayya Huseyn ZadaSurayya Huseyn Zada
authored andcommitted
update EndToEndMultiArch_RemoteRegistry test since containerd store is enabled
1 parent 8bea2ec commit 2e6adab

File tree

2 files changed

+16
-35
lines changed

2 files changed

+16
-35
lines changed

src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/ContainerCli.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ static class ContainerCli
1212
public static RunExeCommand PullCommand(ITestOutputHelper log, params string[] args)
1313
=> CreateCommand(log, "pull", args);
1414

15-
public static RunExeCommand TagCommand(ITestOutputHelper log, params string[] args)
16-
=> CreateCommand(log, "tag", args);
17-
1815
public static RunExeCommand PushCommand(ITestOutputHelper log, params string[] args)
1916
=> CreateCommand(log, "push", args);
2017

src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,7 @@ public void EndToEndMultiArch_RemoteRegistry()
10041004
string imageX64 = $"{imageName}:{imageTag}-linux-x64";
10051005
string imageArm64 = $"{imageName}:{imageTag}-linux-arm64";
10061006
string imageIndex = $"{imageName}:{imageTag}";
1007+
string imageFromRegistry = $"{registry}/{imageIndex}";
10071008

10081009
// Create a new console project
10091010
DirectoryInfo newProjectDir = CreateNewProject("console");
@@ -1031,59 +1032,42 @@ public void EndToEndMultiArch_RemoteRegistry()
10311032
.And.HaveStdOutContaining($"Pushed image '{imageX64}' to registry '{registry}'.")
10321033
.And.HaveStdOutContaining($"Pushed image '{imageArm64}' to registry '{registry}'.")
10331034
.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
10391037
ContainerCli.PullCommand(
10401038
_testOutput,
10411039
"--platform",
10421040
"linux/amd64",
1043-
$"{registry}/{imageIndex}")
1041+
imageFromRegistry)
10441042
.Execute()
10451043
.Should().Pass();
1046-
ContainerCli.TagCommand(
1044+
ContainerCli.PullCommand(
10471045
_testOutput,
1048-
$"{registry}/{imageIndex}",
1049-
imageX64Tagged)
1046+
"--platform",
1047+
"linux/arm64",
1048+
imageFromRegistry)
10501049
.Execute()
10511050
.Should().Pass();
1052-
CommandResult processResultX64 = ContainerCli.RunCommand(
1051+
1052+
// Check that the containers can be run
1053+
ContainerCli.RunCommand(
10531054
_testOutput,
10541055
"--rm",
10551056
"--platform",
10561057
"linux/amd64",
10571058
"--name",
10581059
$"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(
10781063
_testOutput,
10791064
"--rm",
10801065
"--platform",
10811066
"linux/arm64",
10821067
"--name",
10831068
$"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!");
10871071

10881072
// Cleanup
10891073
newProjectDir.Delete(true);

0 commit comments

Comments
 (0)