+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
package main
import (
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
- "git.curoverse.com/arvados.git/sdk/go/keepclient"
"git.curoverse.com/arvados.git/sdk/go/manifest"
dockertypes "github.com/docker/docker/api/types"
return nil
}
-func (t *TestDockerClient) ContainerWait(ctx context.Context, container string) (int64, error) {
- return int64(t.finish), nil
+func (t *TestDockerClient) ContainerWait(ctx context.Context, container string, condition dockercontainer.WaitCondition) (<-chan dockercontainer.ContainerWaitOKBody, <-chan error) {
+ body := make(chan dockercontainer.ContainerWaitOKBody)
+ err := make(chan error)
+ go func() {
+ body <- dockercontainer.ContainerWaitOKBody{StatusCode: int64(t.finish)}
+ close(body)
+ close(err)
+ }()
+ return body, err
}
func (t *TestDockerClient) ImageInspectWithRaw(ctx context.Context, image string) (dockertypes.ImageInspect, []byte, error) {
type FileWrapper struct {
io.ReadCloser
- len uint64
+ len int64
}
-func (fw FileWrapper) Len() uint64 {
+func (fw FileWrapper) Size() int64 {
return fw.len
}
return 0, errors.New("not implemented")
}
-func (client *KeepTestClient) ManifestFileReader(m manifest.Manifest, filename string) (keepclient.Reader, error) {
+func (client *KeepTestClient) ManifestFileReader(m manifest.Manifest, filename string) (arvados.File, error) {
if filename == hwImageId+".tar" {
rdr := ioutil.NopCloser(&bytes.Buffer{})
client.Called = true
return "", 0, errors.New("KeepError")
}
-func (KeepErrorTestClient) ManifestFileReader(m manifest.Manifest, filename string) (keepclient.Reader, error) {
+func (KeepErrorTestClient) ManifestFileReader(m manifest.Manifest, filename string) (arvados.File, error) {
return nil, errors.New("KeepError")
}
return nil
}
-func (ErrorReader) Len() uint64 {
+func (ErrorReader) Size() int64 {
return 0
}
return 0, errors.New("ErrorReader")
}
-func (KeepReadErrorTestClient) ManifestFileReader(m manifest.Manifest, filename string) (keepclient.Reader, error) {
+func (KeepReadErrorTestClient) ManifestFileReader(m manifest.Manifest, filename string) (arvados.File, error) {
return ErrorReader{}, nil
}
extraMounts := []string{}
api, _, _ := FullRunHelper(c, helperRecord, extraMounts, 0, func(t *TestDockerClient) {
- os.Symlink("/does/not/exist", t.realTemp+"/2/baz")
+ os.Symlink("/etc/hosts", t.realTemp+"/2/baz")
t.logWriter.Close()
})