Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
  • Loading branch information
JasonYangShadow committed Feb 20, 2024
1 parent c9de64a commit ef8f839
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions e2e/actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ func (c actionTests) PersistentOverlayAll(t *testing.T) {
argv []string
fakeroot bool
exit int
dir string
}{
{
name: "overlay_create",
Expand Down Expand Up @@ -895,9 +896,11 @@ func (c actionTests) PersistentOverlayAll(t *testing.T) {
},
{
// https://github.com/apptainer/singularity/issues/4270
name: "overlay_dir_relative_path_issue_4270",
argv: []string{"--overlay", "${PARENT_OVERLAY_DIR}", "${SANDBOX_DIR}", "test", "-f", "/dir_overlay"},
exit: 0,
name: "overlay_dir_relative_path_issue_4270",
argv: []string{"--overlay", "${PARENT_OVERLAY_DIR}", "${SANDBOX_DIR}", "test", "-f", "/dir_overlay"},
dir: "${PARENT_OVERLAY_DIR}",
fakeroot: true,
exit: 0,
},
}

Expand All @@ -916,10 +919,16 @@ func (c actionTests) PersistentOverlayAll(t *testing.T) {
newArgs := replaceTemplate(overlayDir, squashDir, ext3Dir, sandboxDir, tt.argv)
args = append(args, newArgs...)

dir := tt.dir
if dir != "" {
dir = strings.ReplaceAll(dir, "${PARENT_OVERLAY_DIR}", filepath.Dir(dir))
}

c.env.RunApptainer(
t,
e2e.AsSubtest(tt.name+"_"+profile.String()),
e2e.WithProfile(profile),
e2e.WithDir(dir),
e2e.WithCommand("exec"),
e2e.WithArgs(args...),
e2e.ExpectExit(tt.exit),
Expand Down

0 comments on commit ef8f839

Please sign in to comment.