Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion internal/update/extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"archive/tar"
"archive/zip"
"compress/gzip"
"errors"
"os"
"path/filepath"
goruntime "runtime"
Expand Down Expand Up @@ -331,7 +332,12 @@ func TestExtractAndReplacePreservesSpecialModeBits(t *testing.T) {
t.Skip("no Unix mode bits on Windows")
}
_, exePath := newInstallDir(t, map[string]string{lstkBinaryName(): "old lstk"})
require.NoError(t, os.Chmod(exePath, 0o755|os.ModeSetgid))
if err := os.Chmod(exePath, 0o755|os.ModeSetgid); errors.Is(err, os.ErrPermission) {
// e.g. a build sandbox where the process isn't in the file's group
t.Skipf("not permitted to set setgid: %v", err)
} else {
require.NoError(t, err)
}
if info, err := os.Stat(exePath); err != nil || info.Mode()&os.ModeSetgid == 0 {
t.Skip("filesystem does not support setgid on files")
}
Expand Down
Loading