tstSessionController.cc 654 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "gtest/gtest.h"

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

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
  sleep(5);
}