-/*flush channel with timeout*/
-func flushChannelExec(channel chan xsapiv1.ExecOutMsg, ms time.Duration) {
- timeoutB := false
- for !timeoutB {
- select {
- case <-channel:
- case <-time.After(ms * time.Millisecond):
- timeoutB = true
- }
- }
+func InitExec(t *testing.T) string {
+ Debugf(t, "Create helloworld directory with app-templates")
+ /*copy helloworld from fixtures to envRootCfgDir*/
+ helloworldDir := path.Join(os.Getenv(envRootCfgDir), "helloworld")
+ cmd := exec.Command("cp", "-r", helloworldFixturesDir, helloworldDir)
+ var out bytes.Buffer
+ cmd.Stdout = &out
+ assert.Nil(t, cmd.Run())
+
+ /*clone submodules app templates into helloworld*/
+ subHelloworldAppTemplateDir := path.Join(helloworldDir, "conf.d", "app-templates")
+ cmd = exec.Command("git", "clone", "https://gerrit.automotivelinux.org/gerrit/p/apps/app-templates.git", subHelloworldAppTemplateDir)
+ assert.Nil(t, cmd.Run())
+ return helloworldDir