summaryrefslogtreecommitdiffstats
path: root/cucumber/features/support/helpers/display_helper.rb
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2017-10-04 13:16:52 +0200
committerHolger Levsen <holger@layer-acht.org>2017-10-04 13:16:52 +0200
commit4d8dfa12768c22f137c236b6e47352afb869a4c8 (patch)
tree1134341bf7a7db322a1da1e24b0e4d6018129a40 /cucumber/features/support/helpers/display_helper.rb
parent213675aa5197309d93331f465297cfd53e0b01f3 (diff)
downloadjenkins.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/display_helper.rb')
-rw-r--r--cucumber/features/support/helpers/display_helper.rb48
1 files changed, 0 insertions, 48 deletions
diff --git a/cucumber/features/support/helpers/display_helper.rb b/cucumber/features/support/helpers/display_helper.rb
deleted file mode 100644
index b4dce733..00000000
--- a/cucumber/features/support/helpers/display_helper.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-
-class Display
-
- def initialize(domain, x_display)
- @domain = domain
- @x_display = x_display
- end
-
- def active?
- p = IO.popen(["xprop", "-display", @x_display,
- "-name", "#{@domain} (1) - Virt Viewer",
- :err => ["/dev/null", "w"]])
- Process.wait(p.pid)
- $?.success?
- end
-
- def start
- @virtviewer = IO.popen(["virt-viewer", "--direct",
- "--kiosk",
- "--reconnect",
- "--connect", "qemu:///system",
- "--display", @x_display,
- @domain,
- :err => ["/dev/null", "w"]])
- # We wait for the display to be active to not lose actions
- # (e.g. key presses via sikuli) that come immediately after
- # starting (or restoring) a vm
- try_for(20, { :delay => 0.1, :msg => "virt-viewer failed to start"}) {
- active?
- }
- end
-
- def stop
- return if @virtviewer.nil?
- Process.kill("TERM", @virtviewer.pid)
- @virtviewer.close
- rescue IOError
- # IO.pid throws this if the process wasn't started yet. Possibly
- # there's a race when doing a start() and then quickly running
- # stop().
- end
-
- def restart
- stop
- start
- end
-
-end