Skip to content

Commit

Permalink
tbs: problem with recent e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Preminger committed Jun 7, 2023
1 parent e9ea408 commit 89d2395
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
32 changes: 15 additions & 17 deletions e2e/actions/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
cdispecs "github.com/container-orchestrated-devices/container-device-interface/specs-go"
"github.com/sylabs/singularity/e2e/internal/e2e"
"github.com/sylabs/singularity/internal/pkg/test/tool/dirs"
"github.com/sylabs/singularity/internal/pkg/test/tool/require"
"github.com/sylabs/singularity/internal/pkg/util/fs"
"gotest.tools/v3/assert"
)
Expand Down Expand Up @@ -1400,6 +1401,10 @@ func countLines(path string) (int, error) {
// Check that write permissions are indeed available for writable FUSE-mounted
// extfs image overlays.
func (c actionTests) actionOciOverlayExtfsPerms(t *testing.T) {
require.Command(t, "fuse2fs")
require.Command(t, "fuse-overlayfs")
require.Command(t, "fusermount")

for _, profile := range e2e.OCIProfiles {
// First, create a writable extfs overlay with `singularity overlay create`.
tmpDir, cleanup := e2e.MakeTempDir(t, c.env.TestDir, "oci_overlay_extfs_perms-", "")
Expand All @@ -1425,34 +1430,27 @@ func (c actionTests) actionOciOverlayExtfsPerms(t *testing.T) {
imageRef := "oci-archive:" + c.env.OCIArchivePath

tests := []struct {
name string
args []string
exitCode int
requiredCmds []string
wantOutputs []e2e.SingularityCmdResultOp
name string
args []string
exitCode int
wantOutputs []e2e.SingularityCmdResultOp
}{
{
name: "FirstWrite",
args: []string{"--overlay", imgPath, imageRef, "sh", "-c", "echo my_test_string > /my_test_file"},
requiredCmds: []string{"fuse2fs", "fuse-overlayfs", "fusermount"},
exitCode: 0,
name: "FirstWrite",
args: []string{"--overlay", imgPath, imageRef, "sh", "-c", "echo my_test_string > /my_test_file"},
exitCode: 0,
},
{
name: "ThenRead",
args: []string{"--overlay", imgPath, imageRef, "cat", "/my_test_file"},
requiredCmds: []string{"fuse2fs", "fuse-overlayfs", "fusermount"},
exitCode: 0,
name: "ThenRead",
args: []string{"--overlay", imgPath, imageRef, "cat", "/my_test_file"},
exitCode: 0,
wantOutputs: []e2e.SingularityCmdResultOp{
e2e.ExpectOutput(e2e.ExactMatch, "my_test_string"),
},
},
}
t.Run(profile.String(), func(t *testing.T) {
for _, tt := range tests {
if !haveAllCommands(t, tt.requiredCmds) {
continue
}

c.env.RunSingularity(
t,
e2e.AsSubtest(tt.name),
Expand Down
4 changes: 4 additions & 0 deletions e2e/docker/regressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"testing"

"github.com/sylabs/singularity/e2e/internal/e2e"
"github.com/sylabs/singularity/internal/pkg/test/tool/dirs"
"github.com/sylabs/singularity/internal/pkg/test/tool/require"
)

Expand Down Expand Up @@ -344,6 +345,9 @@ func (c ctx) issue1670(t *testing.T) {
}
})

dirs.MkdirOrFatal(t, filepath.Join(tmpDir, "upper"), 0o777)
dirs.MkdirOrFatal(t, filepath.Join(tmpDir, "work"), 0o777)

c.env.RunSingularity(
t,
e2e.AsSubtest(profile.String()),
Expand Down

0 comments on commit 89d2395

Please sign in to comment.