btrfs: test btrfs snapshots with driver suite
We now include btrfs in the snapshot driver test suite. This includes the addition of parent links and name hashing into the btrfs driver. We'll probably endup replacing this with a common metadata store, as these relationships are generally identical between implementations. A small bug was discovered in the delete implementation in the course testing, so the btrfs package has been updated with a fix. The overlay driver was modified accordingly with the btrfs driver to use `Driver` as the exported type of each driver packge. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
127882fca7
commit
aeffd4f92c
7 changed files with 276 additions and 71 deletions
|
@ -2,8 +2,10 @@ package testutil
|
|||
|
||||
import (
|
||||
"flag"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
|
@ -55,6 +57,18 @@ func DumpDir(t *testing.T, root string) {
|
|||
return err
|
||||
}
|
||||
t.Log(fi.Mode(), path, "->", target)
|
||||
} else if fi.Mode().IsRegular() {
|
||||
p, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Log("error reading file: %v", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
if len(p) > 64 { // just display a little bit.
|
||||
p = p[:64]
|
||||
}
|
||||
|
||||
t.Log(fi.Mode(), path, "[", strconv.Quote(string(p)), "...]")
|
||||
} else {
|
||||
t.Log(fi.Mode(), path)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue