diff options
author | Pawel Wieczorek <p.wieczorek2@samsung.com> | 2018-06-29 16:16:56 +0200 |
---|---|---|
committer | Pawel Wieczorek <p.wieczorek2@samsung.com> | 2018-06-29 16:16:56 +0200 |
commit | 04ece56c947f40e64cd06c09ad6e34a10d9e7264 (patch) | |
tree | b14189eebd74414e30cd9c22ea71efb921cb69d7 | |
parent | a3531cf131e21ddbe3b01e3976ea918c7480399b (diff) | |
parent | 749232c6efec9dacd9c1560c950680addc6e187e (diff) | |
download | weles-ui.tar.gz weles-ui.tar.bz2 weles-ui.zip |
Merge branch 'runner'ui
Change-Id: Ic7344743f615ac74fbbf8c0e8c6c8fe46dd069fc
-rw-r--r-- | controller/dryaderimpl.go | 8 | ||||
-rw-r--r-- | controller/dryaderimpl_test.go | 10 | ||||
-rw-r--r-- | dryadjobmanager.go | 7 | ||||
-rw-r--r-- | manager/dryad/device_communication_provider.go | 6 | ||||
-rw-r--r-- | manager/dryad/device_communication_provider_test.go | 7 | ||||
-rw-r--r-- | manager/dryad/dryad.go | 5 | ||||
-rw-r--r-- | manager/dryad_job.go | 4 | ||||
-rw-r--r-- | manager/dryad_job_manager.go | 4 | ||||
-rw-r--r-- | manager/dryad_job_manager_test.go | 4 | ||||
-rw-r--r-- | manager/dryad_job_runner.go | 73 | ||||
-rw-r--r-- | manager/dryad_job_runner_conf_test.go | 73 | ||||
-rw-r--r-- | manager/dryad_job_runner_fota.go | 78 | ||||
-rw-r--r-- | manager/dryad_job_runner_fota_test.go | 75 | ||||
-rw-r--r-- | manager/dryad_job_runner_test.go | 96 | ||||
-rw-r--r-- | manager/mock_dryad_test.go | 12 | ||||
-rw-r--r-- | mock/dryadjobmanager.go | 8 |
16 files changed, 384 insertions, 86 deletions
diff --git a/controller/dryaderimpl.go b/controller/dryaderimpl.go index 289be3c..ac5b1d3 100644 --- a/controller/dryaderimpl.go +++ b/controller/dryaderimpl.go @@ -141,9 +141,15 @@ func (h *DryaderImpl) StartJob(j weles.JobID) { return } + config, err := h.jobs.GetConfig(j) + if err != nil { + h.SendFail(j, fmt.Sprintf("Internal Weles error while getting Job config : %s", err.Error())) + return + } + h.add(j) - err = h.djm.Create(j, d, h.listener) + err = h.djm.Create(j, d, config, h.listener) if err != nil { h.remove(j) h.SendFail(j, fmt.Sprintf("Cannot delegate Job to Dryad : %s", err.Error())) diff --git a/controller/dryaderimpl_test.go b/controller/dryaderimpl_test.go index c980f5f..4e11997 100644 --- a/controller/dryaderimpl_test.go +++ b/controller/dryaderimpl_test.go @@ -39,6 +39,7 @@ var _ = Describe("DryaderImpl", func() { j := weles.JobID(0xCAFE) dryad := weles.Dryad{Addr: &net.IPNet{IP: net.IPv4(1, 2, 3, 4), Mask: net.IPv4Mask(5, 6, 7, 8)}} err := errors.New("test error") + conf := weles.Config{JobName: "test123"} expectRegistered := func(offset int) { h.(*DryaderImpl).mutex.Lock() @@ -93,14 +94,16 @@ var _ = Describe("DryaderImpl", func() { Describe("StartJob", func() { It("should register job successfully", func() { jc.EXPECT().GetDryad(j).Return(dryad, nil) - djm.EXPECT().Create(j, dryad, (chan<- weles.DryadJobStatusChange)(h.(*DryaderImpl).listener)) + jc.EXPECT().GetConfig(j).Return(conf, nil) + djm.EXPECT().Create(j, dryad, conf, (chan<- weles.DryadJobStatusChange)(h.(*DryaderImpl).listener)) h.StartJob(j) expectRegistered(1) }) It("should fail if DryadJobManager.Create fails", func() { jc.EXPECT().GetDryad(j).Return(dryad, nil) - djm.EXPECT().Create(j, dryad, (chan<- weles.DryadJobStatusChange)(h.(*DryaderImpl).listener)).Return(err) + jc.EXPECT().GetConfig(j).Return(conf, nil) + djm.EXPECT().Create(j, dryad, conf, (chan<- weles.DryadJobStatusChange)(h.(*DryaderImpl).listener)).Return(err) h.StartJob(j) @@ -132,7 +135,8 @@ var _ = Describe("DryaderImpl", func() { } BeforeEach(func() { jc.EXPECT().GetDryad(j).Return(dryad, nil) - djm.EXPECT().Create(j, dryad, (chan<- weles.DryadJobStatusChange)(h.(*DryaderImpl).listener)) + jc.EXPECT().GetConfig(j).Return(conf, nil) + djm.EXPECT().Create(j, dryad, conf, (chan<- weles.DryadJobStatusChange)(h.(*DryaderImpl).listener)) h.StartJob(j) diff --git a/dryadjobmanager.go b/dryadjobmanager.go index ec732f5..ee6a5c3 100644 --- a/dryadjobmanager.go +++ b/dryadjobmanager.go @@ -18,6 +18,8 @@ package weles +//go:generate mockgen -package mock -destination=mock/dryadjobmanager.go git.tizen.org/tools/weles DryadJobManager + import ( "crypto/rsa" "net" @@ -74,9 +76,12 @@ type DryadJobFilter struct { // DryadJobManager organizes running Jobs on allocated Dryad. type DryadJobManager interface { // Create starts execution of Job definition on allocated Dryad. + // Job's config is passed in order to avoid need to fetch it from Job Manager. + // + // JobID is used only to reference currently executing Jobs. // // Slow read from a channel may miss some events. - Create(JobID, Dryad, chan<- DryadJobStatusChange) error + Create(JobID, Dryad, Config, chan<- DryadJobStatusChange) error // Cancel stops DryadJob associated with Job. // diff --git a/manager/dryad/device_communication_provider.go b/manager/dryad/device_communication_provider.go index 3fca5bf..4334c6a 100644 --- a/manager/dryad/device_communication_provider.go +++ b/manager/dryad/device_communication_provider.go @@ -37,6 +37,12 @@ func NewDeviceCommunicationProvider(session SessionProvider) DeviceCommunication } } +// Boot function is a part of DeviceCommunicationProvider interface. +func (d *deviceCommunicationProvider) Boot() (err error) { + _, _, err = d.sessionProvider.Exec(prefixPath + "dut_boot.sh") + return +} + // Login is a part of DeviceCommunicationProvider interface. func (d *deviceCommunicationProvider) Login(credentials Credentials) error { d.credentials = credentials diff --git a/manager/dryad/device_communication_provider_test.go b/manager/dryad/device_communication_provider_test.go index 046b695..e3bdc2d 100644 --- a/manager/dryad/device_communication_provider_test.go +++ b/manager/dryad/device_communication_provider_test.go @@ -41,6 +41,13 @@ var _ = Describe("DeviceCommunicationProvider", func() { ctrl.Finish() }) + It("should call dut_boot", func() { + mockSession.EXPECT().Exec("/usr/local/bin/dut_boot.sh") + + err := dcp.Boot() + Expect(err).ToNot(HaveOccurred()) + }) + It("should call dut_login", func() { user := "username" pass := "password" diff --git a/manager/dryad/dryad.go b/manager/dryad/dryad.go index ad69f1b..8e1e8b9 100644 --- a/manager/dryad/dryad.go +++ b/manager/dryad/dryad.go @@ -54,6 +54,11 @@ type Credentials struct { // DeviceCommunicationProvider is used to execute steps // from job definition that require communication with DUT. type DeviceCommunicationProvider interface { + // Boot starts DUT and prepares communication so that Login could work. + // + // It can be called more than once to reset DUT's state. + Boot() error + // Login changes user which is used by remaining methods of this interface. // // In case of serial it is simple login to terminal. diff --git a/manager/dryad_job.go b/manager/dryad_job.go index e5ac2c9..f54404a 100644 --- a/manager/dryad_job.go +++ b/manager/dryad_job.go @@ -54,13 +54,13 @@ func newDryadJobWithCancel(job JobID, changes chan<- DryadJobStatusChange, // newDryadJob creates an instance of dryadJob and starts a goroutine // executing phases of given job implemented by provider of DryadJobRunner interface. -func newDryadJob(job JobID, rusalka Dryad, changes chan<- DryadJobStatusChange) *dryadJob { +func newDryadJob(job JobID, rusalka Dryad, conf Config, changes chan<- DryadJobStatusChange) *dryadJob { // FIXME: It should use the proper path to the artifactory. session := dryad.NewSessionProvider(rusalka, "") device := dryad.NewDeviceCommunicationProvider(session) ctx, cancel := context.WithCancel(context.Background()) - runner := newDryadJobRunner(ctx, session, device) + runner := newDryadJobRunner(ctx, session, device, conf) dJob := newDryadJobWithCancel(job, changes, runner, cancel) diff --git a/manager/dryad_job_manager.go b/manager/dryad_job_manager.go index 3e0dcdb..530261a 100644 --- a/manager/dryad_job_manager.go +++ b/manager/dryad_job_manager.go @@ -40,7 +40,7 @@ func NewDryadJobManager() DryadJobManager { } // Create is part of DryadJobManager interface. -func (d *DryadJobs) Create(job JobID, rusalka Dryad, changes chan<- DryadJobStatusChange) error { +func (d *DryadJobs) Create(job JobID, rusalka Dryad, conf Config, changes chan<- DryadJobStatusChange) error { _, ok := d.jobs[job] if ok { return ErrDuplicated @@ -48,7 +48,7 @@ func (d *DryadJobs) Create(job JobID, rusalka Dryad, changes chan<- DryadJobStat d.jobsMutex.Lock() defer d.jobsMutex.Unlock() // FIXME(amistewicz): dryadJobs should not be stored indefinitely. - d.jobs[job] = newDryadJob(job, rusalka, changes) + d.jobs[job] = newDryadJob(job, rusalka, conf, changes) return nil } diff --git a/manager/dryad_job_manager_test.go b/manager/dryad_job_manager_test.go index a543289..795c99c 100644 --- a/manager/dryad_job_manager_test.go +++ b/manager/dryad_job_manager_test.go @@ -35,7 +35,7 @@ var _ = Describe("DryadJobManager", func() { }) create := func() { - err := djm.Create(jobID, Dryad{}, nil) + err := djm.Create(jobID, Dryad{}, Config{}, nil) Expect(err).ToNot(HaveOccurred()) } @@ -51,7 +51,7 @@ var _ = Describe("DryadJobManager", func() { It("should fail to duplicate jobs", func() { create() - err := djm.Create(jobID, Dryad{}, nil) + err := djm.Create(jobID, Dryad{}, Config{}, nil) Expect(err).To(Equal(ErrDuplicated)) }) diff --git a/manager/dryad_job_runner.go b/manager/dryad_job_runner.go index 41df01c..96b65c6 100644 --- a/manager/dryad_job_runner.go +++ b/manager/dryad_job_runner.go @@ -21,6 +21,7 @@ package manager import ( "context" + "git.tizen.org/tools/weles" "git.tizen.org/tools/weles/manager/dryad" ) @@ -30,33 +31,85 @@ type dryadJobRunner struct { ctx context.Context rusalka dryad.SessionProvider device dryad.DeviceCommunicationProvider + conf weles.Config } // newDryadJobRunner prepares a new instance of dryadJobRunner // and returns DryadJobRunner interface to it. -func newDryadJobRunner(ctx context.Context, rusalka dryad.SessionProvider, device dryad.DeviceCommunicationProvider) DryadJobRunner { +func newDryadJobRunner(ctx context.Context, rusalka dryad.SessionProvider, + device dryad.DeviceCommunicationProvider, conf weles.Config) DryadJobRunner { return &dryadJobRunner{ ctx: ctx, rusalka: rusalka, device: device, + conf: conf, } } // Deploy is part of DryadJobRunner interface. -func (d *dryadJobRunner) Deploy() error { - // TODO(amistewicz): implement. - return d.rusalka.TS() +func (d *dryadJobRunner) Deploy() (err error) { + err = d.rusalka.TS() + if err != nil { + return + } + + // Generate partition mapping for FOTA and store it on Dryad. + urls := make([]string, 0, len(d.conf.Action.Deploy.Images)) + for _, image := range d.conf.Action.Deploy.Images { + if p := image.Path; p != "" { + urls = append(urls, p) + } + } + partLayout := make([]fotaMap, 0, len(d.conf.Action.Deploy.PartitionLayout)) + for _, layout := range d.conf.Action.Deploy.PartitionLayout { + if name, part := layout.ImageName, layout.ID; name != "" && part != 0 { + partLayout = append(partLayout, fotaMap{name, part}) + } + + } + mapping := newMapping(partLayout) + _, _, err = d.rusalka.Exec("echo", "'"+string(mapping)+"'", ">", fotaFilePath) + if err != nil { + return + } + + // Run FOTA. + _, _, err = d.rusalka.Exec(newFotaCmd(fotaSDCardPath, fotaFilePath, urls).GetCmd()...) + return err } // Boot is part of DryadJobRunner interface. -func (d *dryadJobRunner) Boot() error { - // TODO(amistewicz): implement. - return d.rusalka.DUT() +func (d *dryadJobRunner) Boot() (err error) { + // Start DUT. + err = d.device.Boot() + if err != nil { + return + } + + // Login to the device only if credentials were specified. + if username, password := d.conf.Action.Boot.Login, d.conf.Action.Boot.Password; username != "" && password != "" { + return d.device.Login(dryad.Credentials{username, password}) + } + return nil } // Test is part of DryadJobRunner interface. func (d *dryadJobRunner) Test() error { - // TODO(amistewicz): implement. - _, _, err := d.rusalka.Exec("echo", "healthcheck") - return err + for _, testcase := range d.conf.Action.Test.TestCases { + for _, testaction := range testcase.TestActions { + switch action := testaction.(type) { + case weles.Push: + d.device.CopyFilesTo([]string{action.Path}, action.Dest) + case weles.Run: + // Exec joins arguments in a single string. + // Split and then Join are avoided. + d.device.Exec(action.Name) + case weles.Pull: + d.device.CopyFilesFrom([]string{action.Src}, action.Path) + default: + panic("unknown test action type") + } + } + } + return nil } diff --git a/manager/dryad_job_runner_conf_test.go b/manager/dryad_job_runner_conf_test.go new file mode 100644 index 0000000..2ad18b8 --- /dev/null +++ b/manager/dryad_job_runner_conf_test.go @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package manager + +import ( + "git.tizen.org/tools/weles" +) + +// basicConfig is incomplete, but contains necessary definitions +// for some of the tests. It can be used as a base for more complex +// definitions. +var basicConfig = weles.Config{ + Action: weles.Action{ + Deploy: weles.Deploy{ + Images: []weles.ImageDefinition{ + {Path: "artifact/path/image1"}, + {Path: "artifact/path/image2"}, + }, + PartitionLayout: []weles.PartitionDefinition{ + { + ID: 1, + ImageName: "image name_1", + Size: "4096", + }, + { + ID: 2, + ImageName: "image_name 2", + Size: "1234", + }, + }, + }, + Boot: weles.Boot{ + Login: "test_login", + Password: "test_password", + Prompts: []string{"prompt ~1"}, + InputSequence: "\n", + WaitPattern: "device login:", + }, + Test: weles.Test{ + TestCases: []weles.TestCase{ + { + TestActions: []weles.TestAction{ + weles.Push{ + Path: "artifact/path/test_push1", + Dest: "dest of test_push1", + }, + weles.Run{ + Name: "command to be run", + }, + weles.Pull{ + Src: "src of test_pull1", + Path: "artifact/path/test_push1", + }, + }, + }, + }, + }, + }, +} diff --git a/manager/dryad_job_runner_fota.go b/manager/dryad_job_runner_fota.go new file mode 100644 index 0000000..fb95ca7 --- /dev/null +++ b/manager/dryad_job_runner_fota.go @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2017-2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +// File manager/dryad_job_runner_fota.go provides wrapper of CLI to fota tool available on Dryad. + +package manager + +import ( + "encoding/json" + "strconv" +) + +const ( + fotaCmdPath = "/usr/bin/fota" + fotaSDCardPath = "/dev/sda" + fotaFilePath = "/tmp/fota.json" +) + +type fotaCmd struct { + sdcard string + mapping string + md5sums string + URLs []string +} + +func newFotaCmd(sdcard, mapping string, urls []string) *fotaCmd { + return &fotaCmd{ + sdcard: sdcard, + mapping: mapping, + URLs: urls, + } +} + +func (f *fotaCmd) SetMD5(url string) { + f.md5sums = url +} + +func (f *fotaCmd) GetCmd() (cmd []string) { + cmd = []string{fotaCmdPath, + "-map", f.mapping, + "-card", f.sdcard} + if f.md5sums != "" { + cmd = append(cmd, "-md5") + cmd = append(cmd, f.md5sums) + } + cmd = append(cmd, f.URLs...) + return +} + +type fotaMap struct { + name string + part int +} + +func newMapping(fms []fotaMap) []byte { + fotaMapping := make(map[string]string) + for _, fm := range fms { + fotaMapping[fm.name] = strconv.Itoa(fm.part) + } + ret, err := json.Marshal(fotaMapping) + if err != nil { + panic(err) + } + return ret +} diff --git a/manager/dryad_job_runner_fota_test.go b/manager/dryad_job_runner_fota_test.go new file mode 100644 index 0000000..0514a82 --- /dev/null +++ b/manager/dryad_job_runner_fota_test.go @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2017-2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package manager + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +var _ = Describe("DryadJobRunnerFota", func() { + var ( + sdcard = "/dev/path to sdcard" + mapping = "path to mapping" + md5 = "url to md5sums" + urls = []string{"https://some secure server", "http://some not so secure one"} + f *fotaCmd + ) + + BeforeEach(func() { + f = newFotaCmd(sdcard, mapping, urls) + }) + + checkOrder := func(cmd []string) { + for i, part := range cmd { + switch part { + case "fota": + Expect(i).To(Equal(0)) + case "-map": + Expect(cmd[i+1]).To(Equal(mapping)) + case "-md5": + Expect(cmd[i+1]).To(Equal(md5)) + case "-card": + Expect(cmd[i+1]).To(Equal(sdcard)) + } + } + } + + It("should work for some arguments", func() { + cmd := f.GetCmd() + Expect(cmd).To(ConsistOf( + fotaCmdPath, + "-card", sdcard, + "-map", mapping, + urls[0], urls[1], + )) + checkOrder(cmd) + }) + + It("should add md5sum argument", func() { + f.SetMD5(md5) + cmd := f.GetCmd() + Expect(cmd).To(ConsistOf( + fotaCmdPath, + "-card", sdcard, + "-map", mapping, + "-md5", md5, + urls[0], urls[1], + )) + checkOrder(cmd) + }) +}) diff --git a/manager/dryad_job_runner_test.go b/manager/dryad_job_runner_test.go index d74a027..ceaaf26 100644 --- a/manager/dryad_job_runner_test.go +++ b/manager/dryad_job_runner_test.go @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2017-2018 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,9 @@ package manager import ( "context" - "errors" + + "git.tizen.org/tools/weles" + "git.tizen.org/tools/weles/manager/dryad" "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" @@ -39,70 +41,42 @@ var _ = Describe("DryadJobRunner", func() { ctrl = gomock.NewController(GinkgoT()) mockSession = NewMockSessionProvider(ctrl) mockDevice = NewMockDeviceCommunicationProvider(ctrl) - djr = newDryadJobRunner(context.Background(), mockSession, mockDevice) + djr = newDryadJobRunner(context.Background(), mockSession, mockDevice, weles.Config{}) }) AfterEach(func() { ctrl.Finish() }) - Describe("Deploy", func() { - var tsCall *gomock.Call - - BeforeEach(func() { - tsCall = mockSession.EXPECT().TS().Times(1) - }) - - It("should switch to TS", func() { - err := djr.Deploy() - Expect(err).ToNot(HaveOccurred()) - }) - - It("should fail if TS fails", func() { - tsCall.Return(errors.New("TS failed")) - - err := djr.Deploy() - Expect(err).To(HaveOccurred()) - }) - }) - - Describe("Boot", func() { - var dutCall *gomock.Call - - BeforeEach(func() { - dutCall = mockSession.EXPECT().DUT().Times(1) - }) - - It("should switch to DUT", func() { - err := djr.Boot() - Expect(err).ToNot(HaveOccurred()) - }) - - It("should fail if DUT fails", func() { - dutCall.Return(errors.New("DUT failed")) - - err := djr.Boot() - Expect(err).To(HaveOccurred()) - }) - }) - - Describe("Test", func() { - var execCall *gomock.Call - - BeforeEach(func() { - execCall = mockSession.EXPECT().Exec([]string{"echo", "healthcheck"}) - }) - - It("should exec echo healthcheck", func() { - err := djr.Test() - Expect(err).ToNot(HaveOccurred()) - }) - - It("should fail if Exec fails", func() { - execCall.Return(nil, nil, errors.New("exec failed")) - - err := djr.Test() - Expect(err).To(HaveOccurred()) - }) + It("should execute the basic weles job definition", func() { + djr = newDryadJobRunner(context.Background(), mockSession, mockDevice, basicConfig) + By("Deploy") + gomock.InOrder( + mockSession.EXPECT().TS(), + mockSession.EXPECT().Exec("echo", "'{\"image name_1\":\"1\",\"image_name 2\":\"2\"}'", ">", fotaFilePath), + mockSession.EXPECT().Exec(newFotaCmd(fotaSDCardPath, fotaFilePath, + []string{basicConfig.Action.Deploy.Images[0].Path, basicConfig.Action.Deploy.Images[1].Path}).GetCmd()), + ) + + Expect(djr.Deploy()).To(Succeed()) + + By("Boot") + gomock.InOrder( + mockDevice.EXPECT().Boot(), + mockDevice.EXPECT().Login(dryad.Credentials{basicConfig.Action.Boot.Login, basicConfig.Action.Boot.Password}), + ) + + Expect(djr.Boot()).To(Succeed()) + + By("Test") + gomock.InOrder( + mockDevice.EXPECT().CopyFilesTo([]string{basicConfig.Action.Test.TestCases[0].TestActions[0].(weles.Push).Path}, + basicConfig.Action.Test.TestCases[0].TestActions[0].(weles.Push).Dest), + mockDevice.EXPECT().Exec("command to be run"), + mockDevice.EXPECT().CopyFilesFrom([]string{basicConfig.Action.Test.TestCases[0].TestActions[2].(weles.Pull).Src}, + basicConfig.Action.Test.TestCases[0].TestActions[2].(weles.Pull).Path), + ) + + Expect(djr.Test()).To(Succeed()) }) }) diff --git a/manager/mock_dryad_test.go b/manager/mock_dryad_test.go index 9fae5b5..391ecdf 100644 --- a/manager/mock_dryad_test.go +++ b/manager/mock_dryad_test.go @@ -122,6 +122,18 @@ func (m *MockDeviceCommunicationProvider) EXPECT() *MockDeviceCommunicationProvi return m.recorder } +// Boot mocks base method +func (m *MockDeviceCommunicationProvider) Boot() error { + ret := m.ctrl.Call(m, "Boot") + ret0, _ := ret[0].(error) + return ret0 +} + +// Boot indicates an expected call of Boot +func (mr *MockDeviceCommunicationProviderMockRecorder) Boot() *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Boot", reflect.TypeOf((*MockDeviceCommunicationProvider)(nil).Boot)) +} + // Close mocks base method func (m *MockDeviceCommunicationProvider) Close() error { ret := m.ctrl.Call(m, "Close") diff --git a/mock/dryadjobmanager.go b/mock/dryadjobmanager.go index 2e93a12..32efb27 100644 --- a/mock/dryadjobmanager.go +++ b/mock/dryadjobmanager.go @@ -46,15 +46,15 @@ func (mr *MockDryadJobManagerMockRecorder) Cancel(arg0 interface{}) *gomock.Call } // Create mocks base method -func (m *MockDryadJobManager) Create(arg0 weles.JobID, arg1 weles.Dryad, arg2 chan<- weles.DryadJobStatusChange) error { - ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2) +func (m *MockDryadJobManager) Create(arg0 weles.JobID, arg1 weles.Dryad, arg2 weles.Config, arg3 chan<- weles.DryadJobStatusChange) error { + ret := m.ctrl.Call(m, "Create", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(error) return ret0 } // Create indicates an expected call of Create -func (mr *MockDryadJobManagerMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockDryadJobManager)(nil).Create), arg0, arg1, arg2) +func (mr *MockDryadJobManagerMockRecorder) Create(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockDryadJobManager)(nil).Create), arg0, arg1, arg2, arg3) } // List mocks base method |