summaryrefslogtreecommitdiff
path: root/src/lbtest_user.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/lbtest_user.hh')
-rw-r--r--src/lbtest_user.hh67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/lbtest_user.hh b/src/lbtest_user.hh
new file mode 100644
index 0000000..534d4d0
--- /dev/null
+++ b/src/lbtest_user.hh
@@ -0,0 +1,67 @@
+/*
+ * Module: lbtest_user.hh
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+#ifndef __LBTEST_USER_HH__
+#define __LBTEST_USER_HH__
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <iostream>
+#include "lbtest.hh"
+
+using namespace std;
+
+/**
+ *
+ *
+ **/
+class LBTestUser : public LBTest
+{
+public:
+ LBTestUser(bool debug) :
+ LBTest(debug)
+ {}
+ LBTestUser(bool debug, string &script) :
+ LBTest(debug),
+ _script(script)
+ {}
+ ~LBTestUser() {}
+
+ void
+ send(LBHealth &health);
+
+ std::string
+ get_script() const {return _script;}
+
+ void
+ set_script(std::string &script) {_script = script;}
+
+ string
+ dump();
+
+ string
+ name() {return string("user");}
+
+ //override, don't need base support for these.
+ void
+ init() {_status_line=name();}
+ void
+ start() {}
+ int
+ recv(LBHealth &health) {return (_state != LBTest::K_SUCCESS) ? -1 : 1;}
+
+
+private: //methods
+ int
+ system_out(const string &cmd, string &out);
+
+private: //variables
+ string _script;
+};
+
+#endif //__LBTEST_USER_HH__