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