}
// Boot is part of DryadJobRunner interface.
-func (d *dryadJobRunner) Boot() error {
- // TODO(amistewicz): implement.
- return d.rusalka.DUT()
+func (d *dryadJobRunner) Boot() (err error) {
+ // Attempt to start a device boot.
+ err = d.rusalka.DUT()
+ if err != nil {
+ return
+ }
+ err = d.rusalka.PowerTick()
+ 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.
"context"
"git.tizen.org/tools/weles"
+ "git.tizen.org/tools/weles/manager/dryad"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo"
)
Expect(djr.Deploy()).To(Succeed())
+
+ By("Boot")
+ gomock.InOrder(
+ mockSession.EXPECT().DUT(),
+ mockSession.EXPECT().PowerTick(),
+ mockDevice.EXPECT().Login(dryad.Credentials{basicConfig.Action.Boot.Login, basicConfig.Action.Boot.Password}),
+ )
+
+ Expect(djr.Boot()).To(Succeed())
})
})