diff options
author | Holger Levsen <holger@layer-acht.org> | 2017-10-04 13:16:52 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-10-04 13:16:52 +0200 |
commit | 4d8dfa12768c22f137c236b6e47352afb869a4c8 (patch) | |
tree | 1134341bf7a7db322a1da1e24b0e4d6018129a40 /cucumber/features/support/helpers/chatbot_helper.rb | |
parent | 213675aa5197309d93331f465297cfd53e0b01f3 (diff) | |
download | jenkins.debian.net-4d8dfa12768c22f137c236b6e47352afb869a4c8.tar.xz |
drop lvc stuff, now that openqa.debian.net is getting into shape
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'cucumber/features/support/helpers/chatbot_helper.rb')
-rw-r--r-- | cucumber/features/support/helpers/chatbot_helper.rb | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/cucumber/features/support/helpers/chatbot_helper.rb b/cucumber/features/support/helpers/chatbot_helper.rb deleted file mode 100644 index 23ce3e1a..00000000 --- a/cucumber/features/support/helpers/chatbot_helper.rb +++ /dev/null @@ -1,59 +0,0 @@ -require 'tempfile' - -class ChatBot - - def initialize(account, password, otr_key, opts = Hash.new) - @account = account - @password = password - @otr_key = otr_key - @opts = opts - @pid = nil - @otr_key_file = nil - end - - def start - @otr_key_file = Tempfile.new("otr_key.", $config["TMPDIR"]) - @otr_key_file << @otr_key - @otr_key_file.close - - cmd_helper(['/usr/bin/convertkey', @otr_key_file.path]) - cmd_helper(["mv", "#{@otr_key_file.path}3", @otr_key_file.path]) - - cmd = [ - "#{GIT_DIR}/features/scripts/otr-bot.py", - @account, - @password, - @otr_key_file.path - ] - cmd += ["--connect-server", @opts["connect_server"]] if @opts["connect_server"] - cmd += ["--auto-join"] + @opts["auto_join"] if @opts["auto_join"] - cmd += ["--log-file", DEBUG_LOG_PSEUDO_FIFO] - - job = IO.popen(cmd) - @pid = job.pid - end - - def stop - @otr_key_file.delete - begin - Process.kill("TERM", @pid) - rescue - # noop - end - end - - def active? - begin - ret = Process.kill(0, @pid) - rescue Errno::ESRCH => e - if e.message == "No such process" - return false - else - raise e - end - end - assert_equal(1, ret, "This shouldn't happen") - return true - end - -end |