X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4879256386a5be9566f31f2c266b682993029e14..ad82cb7409dd62c3ac251e4f98d82ce774f6f528:/lib/crunchrun/crunchrun_test.go diff --git a/lib/crunchrun/crunchrun_test.go b/lib/crunchrun/crunchrun_test.go index 22d65334ed..fa34adf50e 100644 --- a/lib/crunchrun/crunchrun_test.go +++ b/lib/crunchrun/crunchrun_test.go @@ -112,8 +112,11 @@ type stubExecutor struct { exit chan int } -func (e *stubExecutor) ImageLoaded(imageID string) bool { return e.imageLoaded } -func (e *stubExecutor) LoadImage(filename string) error { e.loaded = filename; return e.loadErr } +func (e *stubExecutor) LoadImage(imageId string, tarball string, container arvados.Container, keepMount string, + containerClient *arvados.Client) error { + e.loaded = tarball + return e.loadErr +} func (e *stubExecutor) Create(spec containerSpec) error { e.created = spec; return e.createErr } func (e *stubExecutor) Start() error { e.exit = make(chan int, 1); go e.runFunc(); return e.startErr } func (e *stubExecutor) CgroupID() string { return "cgroupid" } @@ -305,9 +308,11 @@ func (client *KeepTestClient) LocalLocator(locator string) (string, error) { return locator, nil } -func (client *KeepTestClient) PutB(buf []byte) (string, int, error) { - client.Content = buf - return fmt.Sprintf("%x+%d", md5.Sum(buf), len(buf)), len(buf), nil +func (client *KeepTestClient) BlockWrite(_ context.Context, opts arvados.BlockWriteOptions) (arvados.BlockWriteResponse, error) { + client.Content = opts.Data + return arvados.BlockWriteResponse{ + Locator: fmt.Sprintf("%x+%d", md5.Sum(opts.Data), len(opts.Data)), + }, nil } func (client *KeepTestClient) ReadAt(string, []byte, int) (int, error) { @@ -453,8 +458,8 @@ func (*KeepErrorTestClient) ManifestFileReader(manifest.Manifest, string) (arvad return nil, errors.New("KeepError") } -func (*KeepErrorTestClient) PutB(buf []byte) (string, int, error) { - return "", 0, errors.New("KeepError") +func (*KeepErrorTestClient) BlockWrite(context.Context, arvados.BlockWriteOptions) (arvados.BlockWriteResponse, error) { + return arvados.BlockWriteResponse{}, errors.New("KeepError") } func (*KeepErrorTestClient) LocalLocator(string) (string, error) {