tstSessionController.cc 740 Bytes
Newer Older
1
2
3
4
5
#include "gtest/gtest.h"

#include "rsmcore/sessioncontroller.hh"
#include "rsmcore/sessionworker.hh"

6
7
8
9
#ifdef _WIN32
#include <windows.h>
#endif

10
11
12
13
14
15
16
17
18
19
20
21
22
23
using namespace rsm;
TEST(RSM, SessionController)
{
  SessionController controller;
  controller.setHost("apollo");
  controller.setLogVerbosity(SessionVerbosity::None);
  controller.setPort(22);
  controller.setUser("jap");
  controller.connect();          // 1) hand-shake with host
  controller.verifyKnownHost();  // 2) verify host is known/acceptable
  controller.authenticate();     // 3) process authentication
  controller.requestExec("ls -la");
  controller.disconnect();
  // sleep while we wait for the sessionworker to finish
24
#ifdef _WIN32
LEFEBVREJP email's avatar
LEFEBVREJP email committed
25
  Sleep(5000);
26
#else
27
  sleep(5);
28
29
#endif
}