projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '19437-docker-watchdog'
[arvados.git]
/
services
/
keepstore
/
volume_test.go
diff --git
a/services/keepstore/volume_test.go
b/services/keepstore/volume_test.go
index 62582d309feeb1722d99a5fc7aeae6ededc58676..950b3989aa0f6a72e20553f8505f6575a91b39c4 100644
(file)
--- a/
services/keepstore/volume_test.go
+++ b/
services/keepstore/volume_test.go
@@
-2,7
+2,7
@@
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
-package
main
+package
keepstore
import (
"bytes"
import (
"bytes"
@@
-16,7
+16,7
@@
import (
"sync"
"time"
"sync"
"time"
- "git.
curoverse.com
/arvados.git/sdk/go/arvados"
+ "git.
arvados.org
/arvados.git/sdk/go/arvados"
"github.com/sirupsen/logrus"
)
"github.com/sirupsen/logrus"
)
@@
-148,7
+148,7
@@
func (v *MockVolume) Compare(ctx context.Context, loc string, buf []byte) error
}
return nil
} else {
}
return nil
} else {
- return
NotFoundError
+ return
os.ErrNotExist
}
}
}
}
@@
-178,13
+178,20
@@
func (v *MockVolume) Put(ctx context.Context, loc string, block []byte) error {
}
func (v *MockVolume) Touch(loc string) error {
}
func (v *MockVolume) Touch(loc string) error {
+ return v.TouchWithDate(loc, time.Now())
+}
+
+func (v *MockVolume) TouchWithDate(loc string, t time.Time) error {
v.gotCall("Touch")
<-v.Gate
if v.volume.ReadOnly {
return MethodDisabledError
}
v.gotCall("Touch")
<-v.Gate
if v.volume.ReadOnly {
return MethodDisabledError
}
+ if _, exists := v.Store[loc]; !exists {
+ return os.ErrNotExist
+ }
if v.Touchable {
if v.Touchable {
- v.Timestamps[loc] = t
ime.Now()
+ v.Timestamps[loc] = t
return nil
}
return errors.New("Touch failed")
return nil
}
return errors.New("Touch failed")