From 05e807c9e010ba92d9c9737f72804b01fec41ddd Mon Sep 17 00:00:00 2001 From: David Trudgian Date: Mon, 21 Nov 2022 10:29:54 +0000 Subject: [PATCH] e2e: use root and user OCI profiles in action tests Signed-off-by: Edita Kizinevic --- e2e/actions/oci.go | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/e2e/actions/oci.go b/e2e/actions/oci.go index bd811021b4..e586587d25 100644 --- a/e2e/actions/oci.go +++ b/e2e/actions/oci.go @@ -84,7 +84,7 @@ func (c actionTests) actionOciRun(t *testing.T) { c.env.RunApptainer( t, e2e.AsSubtest(tt.name), - e2e.WithProfile(e2e.OCIUserProfile), + e2e.WithProfile(profile), e2e.WithCommand("run"), // While we don't support args we are entering a /bin/sh interactively. e2e.ConsoleRun(e2e.ConsoleSendLine("exit")), @@ -184,15 +184,19 @@ func (c actionTests) actionOciShell(t *testing.T) { }, } - for _, tt := range tests { - c.env.RunApptainer( - t, - e2e.AsSubtest(tt.name), - e2e.WithProfile(e2e.OCIUserProfile), - e2e.WithCommand("shell"), - e2e.WithArgs(tt.argv...), - e2e.ConsoleRun(tt.consoleOps...), - e2e.ExpectExit(tt.exit), - ) + for _, profile := range []e2e.Profile{e2e.OCIRootProfile, e2e.OCIUserProfile} { + t.Run(profile.String(), func(t *testing.T) { + for _, tt := range tests { + c.env.RunApptainer( + t, + e2e.AsSubtest(tt.name), + e2e.WithProfile(profile), + e2e.WithCommand("shell"), + e2e.WithArgs(tt.argv...), + e2e.ConsoleRun(tt.consoleOps...), + e2e.ExpectExit(tt.exit), + ) + } + }) } }