Sha256: 42caba8e1331c203d008620b35a9889d9bca9dcaa3bed7d0b5111bad62551c27

Contents?: true

Size: 1.31 KB

Versions: 30

Compression:

Stored size: 1.31 KB

Contents

Shindo.tests("Fog::Compute[:fogdocker] | container_action request", 'fogdocker') do

  compute = Fog::Compute[:fogdocker]
  name = "fog-#{Time.now.to_i}"
  response = compute.container_create(:name => name, 'image' => 'mattdm/fedora:f19','Cmd' => ['date'])
  id = response['id']

  tests("Start Container") do
    response = compute.container_action(:id => id, :action => :start)
    test("should be a kind of Hash") { response.kind_of? Hash }
    test("should be running") { response['state_running'] == true }
  end

  tests("Stop Container") do
    response = compute.container_action(:id => id, :action => :stop)
    test("should be a kind of Hash") { response.kind_of? Hash }
  end

  tests("Kill Container") do
    response = compute.container_action(:id => id, :action => :kill)
    test("should be a kind of Hash") { response.kind_of? Hash }
    test("should be stopped") { response['state_running'] == false }
  end

  tests("Top Container") do
    response = compute.container_action(:id => id, :action => :top)
    test("should be an Array") { response.kind_of? Array }
    test("should be an array of processes") { !!(response.first['PID'] =~ /^\d+$/) }
  end

  tests("Logs Container") do
    response = compute.container_action(:id => id, :action => :logs)
    test("should be a String") { response.kind_of? String }
  end
end

Version data entries

30 entries across 28 versions & 5 rubygems

Version Path
fog-2.3.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-ifeel-2.2.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-2.2.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-2.1.0 tests/fogdocker/requests/compute/container_action_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/tests/fogdocker/requests/compute/container_action_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/tests/fogdocker/requests/compute/container_action_tests.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.42.1 tests/fogdocker/requests/compute/container_action_tests.rb
fog-2.0.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.42.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.41.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.40.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.39.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.38.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.37.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.36.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.35.0 tests/fogdocker/requests/compute/container_action_tests.rb
fog-2.0.0.pre.0 tests/fogdocker/requests/compute/container_action_tests.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/fogdocker/requests/compute/container_action_tests.rb
fog-1.34.0 tests/fogdocker/requests/compute/container_action_tests.rb