2015-04-07 17:08:28 -04:00
|
|
|
#define CATCH_CONFIG_MAIN
|
|
|
|
#include "catch.hpp"
|
2015-04-29 17:03:15 -04:00
|
|
|
#include "../src/base/network/SFTP.h"
|
2015-04-07 17:08:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
TEST_CASE("ssh connections work", "[SFTP]") {
|
2015-04-08 11:06:24 -04:00
|
|
|
SFTP *sftp = new SFTP("shell.xshellz.com", "twarren", "of0fmk2dsj");
|
|
|
|
sftp->getFingerprint();
|
2015-04-07 17:08:28 -04:00
|
|
|
|
|
|
|
SECTION("sftp object is not null") {
|
|
|
|
REQUIRE(sftp != NULL);
|
|
|
|
}
|
2015-04-08 11:06:24 -04:00
|
|
|
SECTION("can retreive a file") {
|
2015-04-07 17:08:28 -04:00
|
|
|
string file;
|
2015-04-08 11:06:24 -04:00
|
|
|
file = sftp->getFile("test.txt");
|
2015-04-07 17:08:28 -04:00
|
|
|
REQUIRE(file != "");
|
2015-04-08 11:06:24 -04:00
|
|
|
REQUIRE(file == "SFTP works!\n");
|
|
|
|
}
|
2015-04-07 17:08:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|