Skip to content

Commit

Permalink
test/system: CopyDirectory() do not chown files
Browse files Browse the repository at this point in the history
If the source dir is owned by another user then the test the chown will
fail assuming we run the tests rootless. This function is only used by
the quadlet tests and for the purpose all we need is to read the files
so the simple fix is remove the chown as this should make the tests pass
on the special debian gating env.

Fixes #24802

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Dec 17, 2024
1 parent 8729725 commit 23d4908
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions test/e2e/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"strconv"
"strings"
"sync"
"syscall"
"testing"
"time"

Expand Down Expand Up @@ -1469,11 +1468,6 @@ func CopyDirectory(srcDir, dest string) error {
return err
}

stat, ok := fileInfo.Sys().(*syscall.Stat_t)
if !ok {
return fmt.Errorf("failed to get raw syscall.Stat_t data for %q", sourcePath)
}

switch fileInfo.Mode() & os.ModeType {
case os.ModeDir:
if err := os.MkdirAll(destPath, 0755); err != nil {
Expand All @@ -1492,10 +1486,6 @@ func CopyDirectory(srcDir, dest string) error {
}
}

if err := os.Lchown(destPath, int(stat.Uid), int(stat.Gid)); err != nil {
return err
}

fInfo, err := entry.Info()
if err != nil {
return err
Expand Down

0 comments on commit 23d4908

Please sign in to comment.