Class: Kitchen::Driver::Fifo

Inherits:
SSHBase
  • Object
show all
Defined in:
lib/kitchen/driver/fifo.rb

Instance Method Summary collapse

Instance Method Details

#create(state) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/kitchen/driver/fifo.rb', line 19

def create(state)
  server = create_server
  state[:server_id] = server["uuid"]

  info("FIFO instance <#{state[:server_id]}> created.")
  wait_for_server(server)
  print "(server ready)"
  server = connection.vms.get(state[:server_id])
  state[:hostname] = server['config']['networks'].first['ip']
  wait_for_sshd(state[:hostname])      ; print "(ssh ready)\n"
end

#destroy(state) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/kitchen/driver/fifo.rb', line 31

def destroy(state)
  return if state[:server_id].nil?

  server = connection.vms.get(state[:server_id])
  connection.vms.delete(state[:server_id]) unless server.nil?
  info("FIFO instance <#{state[:server_id]}> destroyed.")
  state.delete(:server_id)
  state.delete(:hostname)
end