source sync 20190409
[platform/core/system/edge-orchestration.git] / src / orchestrationapi / orchestration_api_test.go
old mode 100644 (file)
new mode 100755 (executable)
index 2b8cbba..955ea91
 package orchestrationapi
 
+//$
 
 import (
-  "testing"
-  "time"
-  "os/exec"
-  "fmt"
+       "discoverymgr"
+       "fmt"
+       "os/exec"
+       "testing"
+       "time"
 
-  configuremgr     "configuremgr"
-  confdescription  "configuremgr/description"
+       configuremgr "configuremgr"
+       confdescription "configuremgr/description"
 
-  // mockconfiguremgr "configuremgr/mock"
+       // mockconfiguremgr "configuremgr/mock"
 
-  scoringmgr       "scoringmgr"
-  mockscoringmgr   "scoringmgr/mock"
-  
-  // discoverymgr     "discoverymgr"
-  // servicemgr       "servicemgr"
+       scoringmgr "scoringmgr"
+       mockscoringmgr "scoringmgr/mock"
 
+       // discoverymgr     "discoverymgr"
+       servicemgr "servicemgr"
 )
 
-
 //jaehoon.hyun , jaehoon.hyun
-func TestConfigureMgrScoringMgr(t *testing.T){
+func TestConfigureMgrScoringMgr(t *testing.T) {
+
+       //make orche
+       orcheMock := Init("")
+
+       //create modules
+       orcheMock.IScoringmgr = scoringmgr.Init()
+       orcheMock.IConfiguremgr = configuremgr.Init()
+
+       //scoringmgr interface
+       orcheMock.IScoringmgr.IRunningScore = mockscoringmgr.LoadScoringInterfaceAdd
+       orcheMock.IScoringmgr.IStartResourceService = mockscoringmgr.StartResourceServiceAdd
+       orcheMock.IScoringmgr.IStopResourceService = mockscoringmgr.StopResourceServiceAdd
+       orcheMock.IScoringmgr.IGetScore = mockscoringmgr.GetScoreRandom100Mock
+       orcheMock.IScoringmgr.Ch = make(chan interface{}, 1024)
+       //configuremgr interface
+       orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath = PushConfPathDiscoveryDeviceMock
+       orcheMock.IConfiguremgr.IScoringMgr.PushLibPath = scoringmgr.PushLibPath
+       orcheMock.IConfiguremgr.IScoringMgr.Ch = orcheMock.IScoringmgr.Ch
+
+       //discoverymgr interface
+       orcheMock.IDiscoverymgr.GetEndpointDevices = GetEndpointDevicesMock
+
+       //servicemgr interface
+       orcheMock.IServicemgr.ExecuteApp = ExecuteAppMock
+
+       //start scoringmgr
+       orcheMock.IScoringmgr.Listening()
+       orcheMock.IScoringmgr.IStartResourceService()
+
+       //start configuremgr
+       go orcheMock.IConfiguremgr.Watch("/tmp/foo")
 
-  //make orche
-  orcheMock := new(Orche)
+       //init scenario
+       execCommand("rm -rf /tmp/foo/mysum")
+       time.Sleep(time.Duration(1) * time.Second)
 
-  orcheMock.IScoringmgr    = scoringmgr.Init()
-  orcheMock.IConfiguremgr  = configuremgr.Init()
+       //user scenario
+       execCommand(fmt.Sprintf("cp -arR %s %s", "./mock/mysum/", "/tmp/foo"))
+       time.Sleep(time.Duration(3) * time.Second)
 
-  orcheMock.IScoringmgr.IRunningScore = mockscoringmgr.LoadScoringAddInterface
-  orcheMock.IScoringmgr.IGetScore     = mockscoringmgr.GetScoreRandom100Mock
-  orcheMock.IScoringmgr.Ch            = make(chan interface{}, 1024)
+       //release scoringmgr
+       orcheMock.IScoringmgr.IStopResourceService()
+       orcheMock.IScoringmgr.RemoveLib("ls")
 
-  orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath  = pushConfPathDiscoveryDeviceMock
-  orcheMock.IConfiguremgr.IScoringMgr.PushLibPath     = scoringmgr.PushLibPath
-  orcheMock.IConfiguremgr.IScoringMgr.Ch              = orcheMock.IScoringmgr.Ch
+       //release configuremgr
+       orcheMock.IConfiguremgr.Done <- true
 
-  orcheMock.IDiscoverymgr.GetEndpointDevices = getEndpointDevicesMock
-  orcheMock.IServicemgr.ExecuteApp           = executeAppMock
+}
+
+func TestConfigureMgrScoringMgrMyScoringLib(t *testing.T) {
+
+       //make orche
+       orcheMock := new(Orche)
+
+       //create modules
+       orcheMock.IScoringmgr = scoringmgr.Init()
+       orcheMock.IConfiguremgr = configuremgr.Init()
 
+       //scoringmgr interface
+       orcheMock.IScoringmgr.IRunningScore = scoringmgr.LoadScoringGeneralInterface
+       orcheMock.IScoringmgr.IStartResourceService = scoringmgr.StartResourceService
+       orcheMock.IScoringmgr.IStopResourceService = scoringmgr.StopResourceService
+       orcheMock.IScoringmgr.IGetScore = mockscoringmgr.GetScoreRandom100Mock
+       orcheMock.IScoringmgr.Ch = make(chan interface{}, 1024)
 
-  //start module function
-  orcheMock.IScoringmgr.Listening()
-  go orcheMock.IConfiguremgr.Watch("/tmp/foo")
-  
-  //init scenario
-  execCommand("rm -rf /tmp/foo/mysum")
-  time.Sleep(time.Duration(1) * time.Second)
+       //configuremgr interface
+       orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath = PushConfPathDiscoveryDeviceMock
+       orcheMock.IConfiguremgr.IScoringMgr.PushLibPath = scoringmgr.PushLibPath
+       orcheMock.IConfiguremgr.IScoringMgr.Ch = orcheMock.IScoringmgr.Ch
 
-  //user scenario
-  execCommand(fmt.Sprintf("cp -ar %s %s", "./mock/mysum/", "/tmp/foo"))
-  time.Sleep(time.Duration(5) * time.Second)
+       //discoverymgr interface
+       orcheMock.IDiscoverymgr.GetEndpointDevices = GetEndpointDevicesMock
 
+       //servicemgr interface
+       orcheMock.IServicemgr.ExecuteApp = ExecuteAppMock
 
-  orcheMock.IScoringmgr.RemoveLib("/tmp/foo/mysum/libmysum.so")
+       //start scoringmgr
+       orcheMock.IScoringmgr.Listening()
+       orcheMock.IScoringmgr.IStartResourceService()
 
-  orcheMock.IConfiguremgr.Done <- true
+       //start configuremgr
+       go orcheMock.IConfiguremgr.Watch("/tmp/foo")
 
+       //init scenario
+       execCommand("rm -rf /tmp/foo/myscoring")
+       time.Sleep(time.Duration(1) * time.Second)
+
+       //user scenario
+       execCommand(fmt.Sprintf("cp -arR %s %s", "./mock/myscoring/", "/tmp/foo"))
+       time.Sleep(time.Duration(3) * time.Second)
+
+       //release scoringmgr
+       orcheMock.IScoringmgr.IStopResourceService()
+       orcheMock.IScoringmgr.RemoveLib("ls")
+
+       //release configuremgr
+       orcheMock.IConfiguremgr.Done <- true
 }
 
 //jaehoon.hyun, damon92-lee
 func TestConfigureMgrDiscoveryMgr(t *testing.T) {
+       orcheMock := Init("")
+
+       orcheMock.IScoringmgr = scoringmgr.Init()
+       orcheMock.IConfiguremgr = configuremgr.Init()
 
+       orcheMock.IScoringmgr.IRunningScore = mockscoringmgr.LoadScoringInterfaceAdd
+       orcheMock.IScoringmgr.IStartResourceService = mockscoringmgr.StartResourceServiceAdd
+       orcheMock.IScoringmgr.IStopResourceService = mockscoringmgr.StopResourceServiceAdd
+       orcheMock.IScoringmgr.IGetScore = mockscoringmgr.GetScoreRandom100Mock
+       orcheMock.IScoringmgr.Ch = make(chan interface{}, 1024)
+
+       orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath = discoverymgr.AddNewServiceName
+       orcheMock.IConfiguremgr.IScoringMgr.PushLibPath = scoringmgr.PushLibPath
+       orcheMock.IConfiguremgr.IScoringMgr.Ch = orcheMock.IScoringmgr.Ch
+
+       orcheMock.IDiscoverymgr.GetEndpointDevices = discoverymgr.GetDeviceListWithService
+       orcheMock.IServicemgr.ExecuteApp = ExecuteAppMock
+
+       discoverymgr.InitDiscovery()
+
+       //scoringmgr init
+       orcheMock.IScoringmgr.Listening()
+
+       //configuremgr init
+       go orcheMock.IConfiguremgr.Watch("/tmp/foo")
+
+       //init scenario
+       execCommand("rm -rf /tmp/foo/mysum")
+       time.Sleep(time.Duration(1) * time.Second)
+
+       //user scenario
+       execCommand(fmt.Sprintf("cp -ar %s %s", "./mock/mysum/", "/tmp/foo"))
+       time.Sleep(time.Duration(3) * time.Second)
+       RequestService("ls", []string{"-al"})
+
+       //resource release
+       time.Sleep(time.Duration(1) * time.Second)
+       orcheMock.IScoringmgr.RemoveLib("ls")
+       orcheMock.IConfiguremgr.Done <- true
+       discoverymgr.ExitChan <- 1
 }
 
 //jaehoon.hyun, chacha
-func TestRequestServiceFunctionServiceMgr(t *testing.T){
+func TestRequestServiceFunctionServiceMgr(t *testing.T) {
 
-  //make orche
-  // orcheMock := new(Orche)
+       orcheMock := Init("")
 
-  // orcheMock.IScoringmgr    = scoringmgr.Init()
-  // orcheMock.IConfiguremgr  = configuremgr.Init()
+       orcheMock.IScoringmgr = scoringmgr.Init()
+       orcheMock.IConfiguremgr = configuremgr.Init()
 
-  // orcheMock.IScoringmgr.IRunningScore = mockscoringmgr.LoadScoringAddInterface
-  // orcheMock.IScoringmgr.IGetScore     = mockscoringmgr.GetScoreRandom100Mock
-  // orcheMock.IScoringmgr.Ch            = make(chan interface{}, 1024)
+       orcheMock.IScoringmgr.IRunningScore = mockscoringmgr.LoadScoringInterfaceAdd
+       orcheMock.IScoringmgr.IStartResourceService = mockscoringmgr.StartResourceServiceAdd
+       orcheMock.IScoringmgr.IStopResourceService = mockscoringmgr.StopResourceServiceAdd
+       orcheMock.IScoringmgr.IGetScore = mockscoringmgr.GetScoreRandom100Mock
+       orcheMock.IScoringmgr.Ch = make(chan interface{}, 1024)
 
-  // orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath  = pushConfPathDiscoveryDeviceMock
-  // orcheMock.IConfiguremgr.IScoringMgr.PushLibPath     = scoringmgr.PushLibPath
-  // orcheMock.IConfiguremgr.IScoringMgr.Ch              = orcheMock.IScoringmgr.Ch
+       orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath = PushConfPathDiscoveryDeviceMock
+       orcheMock.IConfiguremgr.IScoringMgr.PushLibPath = scoringmgr.PushLibPath
+       orcheMock.IConfiguremgr.IScoringMgr.Ch = orcheMock.IScoringmgr.Ch
 
-  // orcheMock.IDiscoverymgr.GetEndpointDevices = getEndpointDevicesMock
-  // orcheMock.IServicemgr.ExecuteApp           = executeAppMock
+       orcheMock.IDiscoverymgr.GetEndpointDevices = GetEndpointDevicesMock
+       orcheMock.IServicemgr.ExecuteApp = servicemgr.ExecuteApp
 
+       //scoringmgr init
+       orcheMock.IScoringmgr.Listening()
 
-  // //scoringmgr init
-  // orcheMock.IScoringmgr.Listening()
+       //configuremgr init
+       go orcheMock.IConfiguremgr.Watch("/tmp/foo")
 
-  // //configuremgr init
-  // go orcheMock.IConfiguremgr.Watch("/tmp/foo")
+       //servicemgr init
+       servicemgr.Init()
 
-  // //servicemgr init
-  // servicemgr.InitServiceMap()
+       //init scenario
+       execCommand("rm -rf /tmp/foo/mysum")
+       time.Sleep(time.Duration(1) * time.Second)
 
-  // //user scenario
-  // RequestService("mysum", "ls", []string{"-al"})
+       //user scenario
+       execCommand(fmt.Sprintf("cp -ar %s %s", "./mock/mysum/", "/tmp/foo"))
+       time.Sleep(time.Duration(3) * time.Second)
+       RequestService("ls", []string{"-al"})
+
+       //resource release
+       time.Sleep(time.Duration(1) * time.Second)
+       orcheMock.IScoringmgr.RemoveLib("ls")
+       orcheMock.IConfiguremgr.Done <- true
 
 }
 
 //daemon92-lee, chacha
-func TestDiscoveryMgrServiceMgr(t *testing.T){
-
-
+func testDiscoveryMgrServiceMgr(t *testing.T) {
+       // @TODO
 }
 
 //jaehoon.hyun, daemon92-lee, jaehoon.hyun
-func TestConfigureMgrDiscoveryMgrScoringMgr(t *testing.T){
+func TestConfigureMgrDiscoveryMgrScoringMgr(t *testing.T) {
+       orcheMock := Init("")
+
+       orcheMock.IScoringmgr = scoringmgr.Init()
+       orcheMock.IConfiguremgr = configuremgr.Init()
+
+       orcheMock.IScoringmgr.IRunningScore = mockscoringmgr.LoadScoringInterfaceAdd
+       orcheMock.IScoringmgr.IStartResourceService = mockscoringmgr.StartResourceServiceAdd
+       orcheMock.IScoringmgr.IStopResourceService = mockscoringmgr.StopResourceServiceAdd
+       orcheMock.IScoringmgr.IGetScore = scoringmgr.GetScore
+       orcheMock.IScoringmgr.Ch = make(chan interface{}, 1024)
+
+       orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath = discoverymgr.AddNewServiceName
+       orcheMock.IConfiguremgr.IScoringMgr.PushLibPath = scoringmgr.PushLibPath
+       orcheMock.IConfiguremgr.IScoringMgr.Ch = orcheMock.IScoringmgr.Ch
+
+       orcheMock.IDiscoverymgr.GetEndpointDevices = discoverymgr.GetDeviceListWithService
+       orcheMock.IServicemgr.ExecuteApp = ExecuteAppMock
+
+       //scoringmgr init
+       orcheMock.IScoringmgr.Listening()
 
+       //configuremgr init
+       go orcheMock.IConfiguremgr.Watch("/tmp/foo")
+
+       //init scenario
+       execCommand("rm -rf /tmp/foo/mysum")
+       time.Sleep(time.Duration(1) * time.Second)
+
+       discoverymgr.InitDiscovery()
+
+       //user scenario
+       execCommand(fmt.Sprintf("cp -ar %s %s", "../scoringmgr/mock/mysum/", "/tmp/foo"))
+       time.Sleep(time.Duration(3) * time.Second)
+       RequestService("ls", []string{"-al"})
+
+       //resource release
+       time.Sleep(time.Duration(1) * time.Second)
+       orcheMock.IScoringmgr.RemoveLib("ls")
+       orcheMock.IConfiguremgr.Done <- true
+       discoverymgr.ExitChan <- 1
 }
 
 //jaehoon.hyun, daemon92-lee, chacha
-func TestConfigureMgrDiscoveryMgrServiceMgr(t *testing.T){
+func TestConfigureMgrDiscoveryMgrServiceMgr(t *testing.T) {
+       orcheMock := Init("")
+
+       orcheMock.IScoringmgr = scoringmgr.Init()
+       orcheMock.IConfiguremgr = configuremgr.Init()
+
+       orcheMock.IScoringmgr.IRunningScore = mockscoringmgr.LoadScoringInterfaceAdd
+       orcheMock.IScoringmgr.IStartResourceService = mockscoringmgr.StartResourceServiceAdd
+       orcheMock.IScoringmgr.IStopResourceService = mockscoringmgr.StopResourceServiceAdd
+       orcheMock.IScoringmgr.IGetScore = mockscoringmgr.GetScoreRandom100Mock
+       orcheMock.IScoringmgr.Ch = make(chan interface{}, 1024)
+
+       orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath = discoverymgr.AddNewServiceName
+       orcheMock.IConfiguremgr.IScoringMgr.PushLibPath = scoringmgr.PushLibPath
+       orcheMock.IConfiguremgr.IScoringMgr.Ch = orcheMock.IScoringmgr.Ch
+
+       orcheMock.IDiscoverymgr.GetEndpointDevices = discoverymgr.GetDeviceListWithService
+       orcheMock.IServicemgr.ExecuteApp = servicemgr.ExecuteApp
 
+       discoverymgr.InitDiscovery()
+       servicemgr.Init()
+
+       //scoringmgr init
+       orcheMock.IScoringmgr.Listening()
+
+       //init scenario
+       execCommand("rm -rf /tmp/foo/mysum")
+       time.Sleep(time.Duration(1) * time.Second)
+
+       //configuremgr init
+       go orcheMock.IConfiguremgr.Watch("/tmp/foo")
+
+       //user scenario
+       execCommand(fmt.Sprintf("cp -ar %s %s", "./mock/mysum/", "/tmp/foo"))
+       time.Sleep(time.Duration(3) * time.Second)
+       RequestService("ls", []string{"-al"})
+
+       //resource release
+       time.Sleep(time.Duration(1) * time.Second)
+       orcheMock.IScoringmgr.RemoveLib("ls")
+       orcheMock.IConfiguremgr.Done <- true
+       discoverymgr.ExitChan <- 1
 
 }
 
 //jaehoon.hyun, chacha, jaehoon.hyun
-func TestConfigureMgrServiceMgrScoringMgr(t *testing.T){
+func TestConfigureMgrServiceMgrScoringMgr(t *testing.T) {
+       orcheMock := Init("")
+
+       orcheMock.IScoringmgr = scoringmgr.Init()
+       orcheMock.IConfiguremgr = configuremgr.Init()
+
+       orcheMock.IScoringmgr.IRunningScore = mockscoringmgr.LoadScoringInterfaceAdd
+       orcheMock.IScoringmgr.IStartResourceService = mockscoringmgr.StartResourceServiceAdd
+       orcheMock.IScoringmgr.IStopResourceService = mockscoringmgr.StopResourceServiceAdd
+       orcheMock.IScoringmgr.IGetScore = scoringmgr.GetScore
+       orcheMock.IScoringmgr.Ch = make(chan interface{}, 1024)
+
+       orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath = PushConfPathDiscoveryDeviceMock
+       orcheMock.IConfiguremgr.IScoringMgr.PushLibPath = scoringmgr.PushLibPath
+       orcheMock.IConfiguremgr.IScoringMgr.Ch = orcheMock.IScoringmgr.Ch
 
+       orcheMock.IDiscoverymgr.GetEndpointDevices = GetEndpointDevicesMock
+       orcheMock.IServicemgr.ExecuteApp = servicemgr.ExecuteApp
+
+       //scoringmgr init
+       orcheMock.IScoringmgr.Listening()
+
+       //configuremgr init
+       go orcheMock.IConfiguremgr.Watch("/tmp/foo")
+
+       //init scenario
+       execCommand("rm -rf /tmp/foo/mysum")
+       time.Sleep(time.Duration(1) * time.Second)
+
+       servicemgr.Init()
+
+       //user scenario
+       execCommand(fmt.Sprintf("cp -ar %s %s", "./mock/mysum/", "/tmp/foo"))
+       time.Sleep(time.Duration(3) * time.Second)
+       RequestService("ls", []string{"-al"})
+
+       //resource release
+       time.Sleep(time.Duration(1) * time.Second)
+       orcheMock.IScoringmgr.RemoveLib("ls")
+       orcheMock.IConfiguremgr.Done <- true
 }
 
 //jaehoon.hyun, daemon92-lee, chacha, jaehoon.hyun
-func TestConfigureMgrDiscoveryMgrScoringMgrServiceMgr(t *testing.T){
+func TestConfigureMgrDiscoveryMgrScoringMgrServiceMgr(t *testing.T) {
+       orcheMock := Init("")
 
+       orcheMock.IScoringmgr = scoringmgr.Init()
+       orcheMock.IConfiguremgr = configuremgr.Init()
 
-}
+       orcheMock.IScoringmgr.IRunningScore = mockscoringmgr.LoadScoringInterfaceAdd
+       orcheMock.IScoringmgr.IStartResourceService = mockscoringmgr.StartResourceServiceAdd
+       orcheMock.IScoringmgr.IStopResourceService = mockscoringmgr.StopResourceServiceAdd
+       orcheMock.IScoringmgr.IGetScore = scoringmgr.GetScore
+       orcheMock.IScoringmgr.Ch = make(chan interface{}, 1024)
+
+       orcheMock.IConfiguremgr.IDiscoveryMgr.PushConfPath = discoverymgr.AddNewServiceName
+       orcheMock.IConfiguremgr.IScoringMgr.PushLibPath = scoringmgr.PushLibPath
+       orcheMock.IConfiguremgr.IScoringMgr.Ch = orcheMock.IScoringmgr.Ch
 
+       orcheMock.IDiscoverymgr.GetEndpointDevices = discoverymgr.GetDeviceListWithService
+       orcheMock.IServicemgr.ExecuteApp = servicemgr.ExecuteApp
+
+       //scoringmgr init
+       orcheMock.IScoringmgr.Listening()
+
+       //configuremgr init
+       go orcheMock.IConfiguremgr.Watch("/tmp/foo")
+
+       //init scenario
+       execCommand("rm -rf /tmp/foo/mysum")
+       time.Sleep(time.Duration(1) * time.Second)
+
+       discoverymgr.InitDiscovery()
+       servicemgr.Init()
+
+       //user scenario
+       execCommand(fmt.Sprintf("cp -ar %s %s", "./mock/mysum/", "/tmp/foo"))
+       time.Sleep(time.Duration(3) * time.Second)
+       RequestService("ls", []string{"-al"})
+
+       //resource release
+       time.Sleep(time.Duration(1) * time.Second)
+       orcheMock.IScoringmgr.RemoveLib("ls")
+       orcheMock.IConfiguremgr.Done <- true
+       discoverymgr.ExitChan <- 1
 
-func pushConfPathDiscoveryDeviceMock (doc *confdescription.Doc) (err error) {
-  ILog.Println("pushConfPathDiscoveryDeviceMock")
-  ILog.Println(*doc)
-  return
 }
 
-func pushLibPathScoringAppMock(libPath string, doc *confdescription.Doc, handlersCh chan<- interface{}) (err error) {
-  ILog.Println("pushLibPathScoringAppMock")
-  ILog.Println(libPath)
-  return
+func PushConfPathDiscoveryDeviceMock(doc *confdescription.Doc) (err error) {
+       ILog.Println("pushConfPathDiscoveryDeviceMock")
+       ILog.Println(*doc)
+       return
 }
 
-func getEndpointDevicesMock(serviceName string) []string {
-  return []string{"localhost", "localhost"}
+func PushLibPathScoringAppMock(libPath string, doc *confdescription.Doc, handlersCh chan<- interface{}) (err error) {
+       ILog.Println("pushLibPathScoringAppMock")
+       ILog.Println(libPath)
+       return
 }
 
-func executeAppMock(target string, name string, args []string, notiChan chan string) (serviceID uint64, err error) {
-  ILog.Println("ExecuteApp")
-  ILog.Println(target)
-  ILog.Println(name)
-  ILog.Println(args)
-  return
+func GetEndpointDevicesMock(serviceName string) ([]string, error) {
+       DLog.Printf("GetEndpointDevicesMock serviceName: %s\n", serviceName)
+       return []string{"localhost"}, nil
 }
 
+func ExecuteAppMock(target string, name string, args []string, notiChan chan string) (serviceID uint64, err error) {
+       ILog.Println("ExecuteApp")
+       ILog.Println(target)
+       ILog.Println(name)
+       ILog.Println(args)
+       return
+}
 
 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)
-  }
-}
\ No newline at end of file
+       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)
+       }
+}