mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
22 lines
359 B
Go
22 lines
359 B
Go
package fs
|
|
|
|
import (
|
|
"os/exec"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestSetNOCOW(t *testing.T) {
|
|
if IsBtrfs("/") {
|
|
SetNOCOW("/")
|
|
cmd := exec.Command("lsattr", "/")
|
|
out, err := cmd.Output()
|
|
if err != nil {
|
|
t.Fatal("Failed executing lsattr")
|
|
}
|
|
if strings.Contains(string(out), "---------------C") {
|
|
t.Fatal("Failed setting NOCOW:\n", out)
|
|
}
|
|
}
|
|
}
|