fix: skip permission tests when running as root (CI/Docker)
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
f684a7f845
commit
f1e55b370f
1 changed files with 6 additions and 0 deletions
|
|
@ -75,6 +75,9 @@ func TestSanitizePathComponent_Bad_Invalid(t *testing.T) {
|
|||
// --- Journal: Append with readonly directory ---
|
||||
|
||||
func TestJournal_Append_Bad_ReadonlyDir(t *testing.T) {
|
||||
if os.Getuid() == 0 {
|
||||
t.Skip("chmod does not restrict root")
|
||||
}
|
||||
// Create a dir that we then make readonly (only works as non-root).
|
||||
dir := t.TempDir()
|
||||
readonlyDir := filepath.Join(dir, "readonly")
|
||||
|
|
@ -328,6 +331,9 @@ func TestPoller_Run_Good_ImmediateCancel(t *testing.T) {
|
|||
// --- Journal: Append with journal error logging ---
|
||||
|
||||
func TestPoller_RunOnce_Good_JournalAppendError(t *testing.T) {
|
||||
if os.Getuid() == 0 {
|
||||
t.Skip("chmod does not restrict root")
|
||||
}
|
||||
// Use a directory that will cause journal writes to fail.
|
||||
dir := t.TempDir()
|
||||
journal, err := NewJournal(dir)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue