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

Commit 63a5d7b

Browse files
skonefalppalucki
authored andcommitted
Remove test for unavailable feature (#655)
* Test renamed. * Test change. * Removed test for unavailable feature. * Import fix.
1 parent bcc290e commit 63a5d7b

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

integration_tests/pkg/executor/remote_test.go

-40
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
package executor
1616

1717
import (
18-
"os/exec"
19-
"strings"
2018
"testing"
2119

2220
. "github.com/intelsdi-x/swan/pkg/executor"
@@ -39,41 +37,3 @@ func TestRemote(t *testing.T) {
3937
})
4038
})
4139
}
42-
43-
func got(t *testing.T) {
44-
Convey("I should be able to execute remote command and see the processes running", t, func() {
45-
config := DefaultRemoteConfig()
46-
remote, err := NewRemote("127.0.0.1", config)
47-
if err != nil {
48-
t.Skip("Skipping remote executor test: " + err.Error())
49-
}
50-
51-
handle, err := remote.Execute("sleep inf & sleep inf")
52-
So(err, ShouldBeNil)
53-
54-
sleepProcCount := findProcessCount("sleep")
55-
So(sleepProcCount, ShouldEqual, 2)
56-
57-
Convey("I should be able to stop remote task and all the processes should be terminated", func() {
58-
err = handle.Stop()
59-
So(err, ShouldBeNil)
60-
61-
sleepProcCountAfterStop := findProcessCount("sleep")
62-
So(sleepProcCountAfterStop, ShouldEqual, 0)
63-
})
64-
})
65-
}
66-
67-
func findProcessCount(processName string) int {
68-
const separator = ","
69-
70-
cmd := exec.Command("pgrep", processName, "-d "+separator)
71-
output, _ := cmd.Output()
72-
73-
if len(output) == 0 {
74-
return 0
75-
}
76-
77-
pids := strings.Split(string(output), ",")
78-
return len(pids)
79-
}

0 commit comments

Comments
 (0)