@ -35,7 +35,6 @@ import (
"io/ioutil"
"io/ioutil"
"os"
"os"
"os/exec"
"os/exec"
"os/user"
"path/filepath"
"path/filepath"
"runtime"
"runtime"
"sync"
"sync"
@ -175,13 +174,9 @@ func TestCopyDirFail_SrcInaccessible(t *testing.T) {
t . Skip ( "skipping on windows" )
t . Skip ( "skipping on windows" )
}
}
var currentU ser, err = user . Current ( )
var currentU ID = os . Getuid ( )
if err != nil {
if currentUID == 0 {
t . Fatalf ( "Failed to get name of current user: %s" , err )
}
if currentUser . Name == "root" {
// Skipping if root, because all files are accessible
// Skipping if root, because all files are accessible
t . Skip ( "Skipping for root user" )
t . Skip ( "Skipping for root user" )
}
}
@ -214,13 +209,9 @@ func TestCopyDirFail_DstInaccessible(t *testing.T) {
t . Skip ( "skipping on windows" )
t . Skip ( "skipping on windows" )
}
}
var currentU ser, err = user . Current ( )
var currentU ID = os . Getuid ( )
if err != nil {
if currentUID == 0 {
t . Fatalf ( "Failed to get name of current user: %s" , err )
}
if currentUser . Name == "root" {
// Skipping if root, because all files are accessible
// Skipping if root, because all files are accessible
t . Skip ( "Skipping for root user" )
t . Skip ( "Skipping for root user" )
}
}
@ -314,13 +305,9 @@ func TestCopyDirFailOpen(t *testing.T) {
t . Skip ( "skipping on windows" )
t . Skip ( "skipping on windows" )
}
}
var currentUser , err = user . Current ( )
var currentUID = os . Getuid ( )
if err != nil {
t . Fatalf ( "Failed to get name of current user: %s" , err )
}
if currentU ser. Name == "root" {
if currentUID == 0 {
// Skipping if root, because all files are accessible
// Skipping if root, because all files are accessible
t . Skip ( "Skipping for root user" )
t . Skip ( "Skipping for root user" )
}
}
@ -483,13 +470,9 @@ func TestCopyFileFail(t *testing.T) {
t . Skip ( "skipping on windows" )
t . Skip ( "skipping on windows" )
}
}
var currentU ser, err = user . Current ( )
var currentU ID = os . Getuid ( )
if err != nil {
if currentUID == 0 {
t . Fatalf ( "Failed to get name of current user: %s" , err )
}
if currentUser . Name == "root" {
// Skipping if root, because all files are accessible
// Skipping if root, because all files are accessible
t . Skip ( "Skipping for root user" )
t . Skip ( "Skipping for root user" )
}
}
@ -574,13 +557,9 @@ func setupInaccessibleDir(t *testing.T, op func(dir string) error) func() {
func TestIsDir ( t * testing . T ) {
func TestIsDir ( t * testing . T ) {
var currentU ser, err = user . Current ( )
var currentU ID = os . Getuid ( )
if err != nil {
if currentUID == 0 {
t . Fatalf ( "Failed to get name of current user: %s" , err )
}
if currentUser . Name == "root" {
// Skipping if root, because all files are accessible
// Skipping if root, because all files are accessible
t . Skip ( "Skipping for root user" )
t . Skip ( "Skipping for root user" )
}
}
@ -631,13 +610,9 @@ func TestIsDir(t *testing.T) {
func TestIsSymlink ( t * testing . T ) {
func TestIsSymlink ( t * testing . T ) {
var currentUser , err = user . Current ( )
var currentUID = os . Getuid ( )
if err != nil {
t . Fatalf ( "Failed to get name of current user: %s" , err )
}
if currentU ser. Name == "root" {
if currentUID == 0 {
// Skipping if root, because all files are accessible
// Skipping if root, because all files are accessible
t . Skip ( "Skipping for root user" )
t . Skip ( "Skipping for root user" )
}
}