Class: Console::KvmMachine

Inherits:
Object
  • Object
show all
Defined in:
lib/console/kvm_machine.rb

Instance Method Summary collapse

Constructor Details

#initialize(domain) ⇒ KvmMachine

Returns a new instance of KvmMachine.



5
6
7
# File 'lib/console/kvm_machine.rb', line 5

def initialize(domain)
        @domain = domain
end

Instance Method Details

#execute(cli) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/console/kvm_machine.rb', line 22

def execute(cli)
		Console::Conversation.talk_with(@domain) do
 exepecting connected
 enter ''
 exepecting waiting_shell
 enter cli
 exepecting waiting_shell
		end
  	
end

#loginObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/console/kvm_machine.rb', line 9

def 
		Console::Conversation.talk_with(@domain) do
   exepecting  connected
   enter 'ronen'
   exepecting post_uname.chomp!
   enter "xaL2ohM0"
   sleep 3
   puts read
   # exepecting logged_in -> we can't match since it contains date
		end
end

#logoutObject



33
34
35
36
37
38
39
# File 'lib/console/kvm_machine.rb', line 33

def logout
		Console::Conversation.talk_with(@domain) do
 exepecting connected
 enter 'logout'
 return exepecting logout.chomp!
		end
end