mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-09 06:31:02 +00:00
make sure remote_test.go does not run if pem file is not available
This commit is contained in:
parent
1d3d7ca400
commit
60423735af
1 changed files with 11 additions and 5 deletions
|
|
@ -14,7 +14,7 @@ func TestRemote(t *testing.T) {
|
|||
Convey("Login", t, func() {
|
||||
pem_file := "id_dsa"
|
||||
if _, err := os.Stat(pem_file); err == nil {
|
||||
ssh, err := New("50.16.204.123:22", "todd", "id_dsa")
|
||||
ssh, err := New("50.16.204.123:22", "todd", pem_file)
|
||||
So(err, ShouldEqual, nil)
|
||||
err = ssh.Launch("sleep 10 && date", "background")
|
||||
So(err, ShouldEqual, nil)
|
||||
|
|
@ -26,15 +26,21 @@ func TestRemote(t *testing.T) {
|
|||
ok := bytes.Equal([]byte(content), out.Bytes())
|
||||
So(ok, ShouldEqual, true)
|
||||
} else {
|
||||
fmt.Println("No credentials so SSH Test ignored")
|
||||
fmt.Println("No credentials to SSH. Test ignored.")
|
||||
So(true, ShouldEqual, true)
|
||||
}
|
||||
})
|
||||
Convey("BigFile", t, func() {
|
||||
ssh, _ := New("50.16.204.123:22", "todd", "id_dsa")
|
||||
pem_file := "id_dsa"
|
||||
if _, err := os.Stat(pem_file); err == nil {
|
||||
ssh, _ := New("50.16.204.123:22", "todd", pem_file)
|
||||
|
||||
ssh.SimpleFileCopyTo("outbin", "tb")
|
||||
ssh.SimpleFileCopyFrom("tb", "outbin2")
|
||||
ssh.SimpleFileCopyTo("outbin", "tb")
|
||||
ssh.SimpleFileCopyFrom("tb", "outbin2")
|
||||
} else {
|
||||
fmt.Println("No credentials to SSH. Test ignored.")
|
||||
So(true, ShouldEqual, true)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue