//test object
configuremgrObj := configuremgr.Init()
- configuremgrObj.IDeviceDiscoveryMgr.PushConfPath = mockconfiguremgr.PushConfPathDiscoveryDeviceMock
- configuremgrObj.IAppExecuteMgr.PushConfPath = mockconfiguremgr.PushConfPathAppExecuteMock
+ configuremgrObj.IDiscoveryMgr.PushConfPath = mockconfiguremgr.PushConfPathDiscoveryDeviceMock
configuremgrObj.IScoringMgr.PushLibPath = mockconfiguremgr.PushLibPathScoringAppMock
//TODO : push /tmp/foo/simple directory using Cmd package
time.Sleep(time.Duration(1 * time.Second))
- command := fmt.Sprintf("cp -r %s %s", src, dst)
- configuremgr.DLog.Println(command)
+
+ //init scenario
+ execCommand("rm -rf /tmp/foo/mysum")
+ time.Sleep(time.Duration(1) * time.Second)
+
+ //user scenario
+ execCommand(fmt.Sprintf("cp -ar %s %s", src, dst))
+ time.Sleep(time.Duration(5) * time.Second)
+
+ configuremgrObj.Done <- true
+}
+
+func execCommand(command string) {
+ configuremgr.DLog.Println(command)
cmd := exec.Command("sh", "-c", command)
stdoutStderr, err := cmd.CombinedOutput()
configuremgr.DLog.Printf("%s", stdoutStderr)
if err != nil {
configuremgr.ELog.Fatal(err)
}
-
- configuremgrObj.Done <- true
}
\ No newline at end of file