Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Remove test for unavailable feature #655

Merged
merged 5 commits into from
May 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions integration_tests/pkg/executor/remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
package executor

import (
"os/exec"
"strings"
"testing"

. "github.com/intelsdi-x/swan/pkg/executor"
Expand All @@ -39,41 +37,3 @@ func TestRemote(t *testing.T) {
})
})
}

func got(t *testing.T) {
Convey("I should be able to execute remote command and see the processes running", t, func() {
config := DefaultRemoteConfig()
remote, err := NewRemote("127.0.0.1", config)
if err != nil {
t.Skip("Skipping remote executor test: " + err.Error())
}

handle, err := remote.Execute("sleep inf & sleep inf")
So(err, ShouldBeNil)

sleepProcCount := findProcessCount("sleep")
So(sleepProcCount, ShouldEqual, 2)

Convey("I should be able to stop remote task and all the processes should be terminated", func() {
err = handle.Stop()
So(err, ShouldBeNil)

sleepProcCountAfterStop := findProcessCount("sleep")
So(sleepProcCountAfterStop, ShouldEqual, 0)
})
})
}

func findProcessCount(processName string) int {
const separator = ","

cmd := exec.Command("pgrep", processName, "-d "+separator)
output, _ := cmd.Output()

if len(output) == 0 {
return 0
}

pids := strings.Split(string(output), ",")
return len(pids)
}