Skip to content

Commit

Permalink
Merge pull request #2724 from dtrudg/issue2723
Browse files Browse the repository at this point in the history
e2e: use OCI profile, not `--oci`
  • Loading branch information
dtrudg authored Mar 7, 2024
2 parents 6935fa7 + 3667c0f commit 74feead
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions e2e/internal/e2e/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ func EnsureOCISIF(t *testing.T, env TestEnv) {

env.RunSingularity(
t,
WithProfile(UserProfile),
WithProfile(OCIUserProfile),
WithCommand("pull"),
WithArgs("--oci", "--no-https", env.OCISIFPath, env.TestRegistryImage),
WithArgs("--no-https", env.OCISIFPath, env.TestRegistryImage),
ExpectExit(0),
)
}
Expand Down
11 changes: 6 additions & 5 deletions e2e/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ func (c *ctx) imagePull(t *testing.T, tt testStruct) {
argv += "--library " + tt.library + " "
}

if tt.oci {
argv += "--oci "
}

if tt.keepLayers {
argv += "--keep-layers "
}
Expand All @@ -131,9 +127,14 @@ func (c *ctx) imagePull(t *testing.T, tt testStruct) {

argv += tt.srcURI

profile := e2e.UserProfile
if tt.oci {
profile = e2e.OCIUserProfile
}

c.env.RunSingularity(
t,
e2e.WithProfile(e2e.UserProfile),
e2e.WithProfile(profile),
e2e.WithEnv(tt.envVars),
e2e.WithDir(tt.workDir),
e2e.WithCommand("pull"),
Expand Down
12 changes: 10 additions & 2 deletions e2e/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ func (c ctx) registryAuthTester(t *testing.T, withCustomAuthFile bool) {
name string
cmd string
args []string
oci bool
whileLoggedIn bool
expectExit int
}{
Expand Down Expand Up @@ -353,7 +354,8 @@ func (c ctx) registryAuthTester(t *testing.T, withCustomAuthFile bool) {
{
name: "docker pull ocisif",
cmd: "pull",
args: []string{"-F", "--oci", "--disable-cache", "--no-https", c.env.TestRegistryPrivImage},
args: []string{"-F", "--disable-cache", "--no-https", c.env.TestRegistryPrivImage},
oci: true,
whileLoggedIn: true,
expectExit: 0,
},
Expand Down Expand Up @@ -407,10 +409,16 @@ func (c ctx) registryAuthTester(t *testing.T, withCustomAuthFile bool) {
} else {
e2e.PrivateRepoLogout(t, c.env, e2e.UserProfile, localAuthFileName)
}

profile := e2e.UserProfile
if tt.oci {
profile = e2e.OCIUserProfile
}

c.env.RunSingularity(
t,
e2e.AsSubtest(tt.name),
e2e.WithProfile(e2e.UserProfile),
e2e.WithProfile(profile),
e2e.WithCommand(tt.cmd),
e2e.WithArgs(append(authFileArgs, tt.args...)...),
e2e.ExpectExit(tt.expectExit),
Expand Down

0 comments on commit 74feead

Please sign in to comment.