Failing integration test for folders + readonly (ref #231)
This commit is contained in:
parent
c08ce5c571
commit
d7df11e724
|
@ -1,15 +1,15 @@
|
||||||
<configuration version="1">
|
<configuration version="1">
|
||||||
<repository directory="s1" ro="true">
|
<repository directory="s1" ro="true">
|
||||||
<node id="I6KAH7666SLLL5PFXSOAUFJCDZYAOMLEKCP2GB3BV5RQST3PSROA" name="s1">
|
<node id="I6KAH7666SLLL5PFXSOAUFJCDZYAOMLEKCP2GB3BV5RQST3PSROA" name="f1">
|
||||||
<address>127.0.0.1:22001</address>
|
<address>127.0.0.1:22001</address>
|
||||||
</node>
|
</node>
|
||||||
<node id="JMFJCXBGZDE4BOCJE3VF65GYZNAIVJRET3J6HMRAUQIGJOFKNHMQ" name="s2">
|
<node id="JMFJCXBGZDE4BOCJE3VF65GYZNAIVJRET3J6HMRAUQIGJOFKNHMQ" name="f2">
|
||||||
<address>127.0.0.1:22002</address>
|
<address>127.0.0.1:22002</address>
|
||||||
</node>
|
</node>
|
||||||
</repository>
|
</repository>
|
||||||
<options>
|
<options>
|
||||||
<listenAddress>127.0.0.1:22001</listenAddress>
|
<listenAddress>127.0.0.1:22001</listenAddress>
|
||||||
<readOnly>false</readOnly>
|
<readOnly>true</readOnly>
|
||||||
<allowDelete>true</allowDelete>
|
<allowDelete>true</allowDelete>
|
||||||
<followSymlinks>true</followSymlinks>
|
<followSymlinks>true</followSymlinks>
|
||||||
<guiEnabled>true</guiEnabled>
|
<guiEnabled>true</guiEnabled>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<configuration version="1">
|
<configuration version="1">
|
||||||
<repository directory="s2">
|
<repository directory="s2">
|
||||||
<node id="I6KAH7666SLLL5PFXSOAUFJCDZYAOMLEKCP2GB3BV5RQST3PSROA" name="s1">
|
<node id="I6KAH7666SLLL5PFXSOAUFJCDZYAOMLEKCP2GB3BV5RQST3PSROA" name="f1">
|
||||||
<address>127.0.0.1:22001</address>
|
<address>127.0.0.1:22001</address>
|
||||||
</node>
|
</node>
|
||||||
<node id="JMFJCXBGZDE4BOCJE3VF65GYZNAIVJRET3J6HMRAUQIGJOFKNHMQ" name="s2">
|
<node id="JMFJCXBGZDE4BOCJE3VF65GYZNAIVJRET3J6HMRAUQIGJOFKNHMQ" name="f2">
|
||||||
<address>127.0.0.1:22002</address>
|
<address>127.0.0.1:22002</address>
|
||||||
</node>
|
</node>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
|
@ -11,7 +11,7 @@ go build json.go
|
||||||
start() {
|
start() {
|
||||||
echo "Starting..."
|
echo "Starting..."
|
||||||
for i in 1 2 ; do
|
for i in 1 2 ; do
|
||||||
STPROFILER=":909$i" syncthing -home "f$i" &
|
STTRACE=linenumbers STPROFILER=":909$i" syncthing -home "f$i" &
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,11 +51,11 @@ testConvergence() {
|
||||||
echo "Verifying..."
|
echo "Verifying..."
|
||||||
|
|
||||||
pushd s1 >/dev/null
|
pushd s1 >/dev/null
|
||||||
find . -type d | sort > ../dirs-1
|
../md5r -d | grep -v ' . ' > ../dirs-1
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
pushd s2 >/dev/null
|
pushd s2 >/dev/null
|
||||||
find . -type d | sort > ../dirs-2
|
../md5r -d | grep -v ' . ' > ../dirs-2
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
if ! cmp dirs-1 dirs-2 ; then
|
if ! cmp dirs-1 dirs-2 ; then
|
||||||
|
@ -66,7 +66,7 @@ testConvergence() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rm -rf s? s??-?
|
rm -rf s? s??-?
|
||||||
rm -f h?/*.idx.gz
|
rm -f f?/*.idx.gz
|
||||||
|
|
||||||
setup
|
setup
|
||||||
start
|
start
|
||||||
|
|
|
@ -11,10 +11,14 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
var long bool
|
var (
|
||||||
|
long bool
|
||||||
|
dirs bool
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.BoolVar(&long, "l", false, "Long output")
|
flag.BoolVar(&long, "l", false, "Long output")
|
||||||
|
flag.BoolVar(&dirs, "d", false, "Check dirs")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
args := flag.Args()
|
args := flag.Args()
|
||||||
|
|
||||||
|
@ -37,14 +41,15 @@ func walker(path string, info os.FileInfo, err error) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !info.IsDir() {
|
if dirs && info.IsDir() {
|
||||||
|
fmt.Printf("%s %s 0%03o %d\n", "-", path, info.Mode(), info.ModTime().Unix())
|
||||||
|
} else if !info.IsDir() {
|
||||||
sum, err := md5file(path)
|
sum, err := md5file(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if long {
|
if long {
|
||||||
fmt.Printf("%s %s 0%03o %d\n", sum, path, info.Mode(), info.ModTime().Unix())
|
fmt.Printf("%s %s 0%03o %d\n", sum, path, info.Mode(), info.ModTime().Unix())
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("%s %s\n", sum, path)
|
fmt.Printf("%s %s\n", sum, path)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue