added booted?/boot methods
[strongswan.git] / src / dumm / ext / lib / dumm / guest.rb
index a65a0a7..8f5abb5 100644 (file)
@@ -41,6 +41,23 @@ module Dumm
         i.delete
       }
     end
+    
+    # has the guest booted up?
+    def booted?
+      begin
+        exec("pgrep getty")
+      rescue
+        return false
+      end
+      return true
+    end
+    
+    # wait until the guest has booted
+    def boot
+      while not booted?
+        sleep(1)
+      end
+    end
   end
 end