Project

General

Profile

Revision bc82d5d5

Added by Vanya Jauhal almost 8 years ago

Fixes #7865 - Adds support for configuring dns during container creation

View differences:

test/functionals/containers_steps_controller_test.rb
59 59
      assert @container.parametrize["ExposedPorts"].key? "1654/tcp"
60 60
      assert @container.parametrize["ExposedPorts"].key? "1655/udp"
61 61
    end
62

  
63
    test 'new container respects dns configuration' do
64
      state = DockerContainerWizardState.create!
65
      environment_options = {
66
        :docker_container_wizard_state_id => state.id
67
      }
68
      state.environment = DockerContainerWizardStates::Environment.create!(environment_options)
69
      state.environment.dns.create!(:name => '18.18.18.18')
70
      state.environment.dns.create!(:name => '19.19.19.19')
71
      get :show, { :wizard_state_id => state.id, :id => :environment }, set_session_user
72
      assert response.body.include?("18.18.18.18")
73
      assert response.body.include?("19.19.19.19")
74

  
75
      # Load Dns variables into container
76
      state.environment.dns.each do |e|
77
        @container.dns.build :name => e.name,
78
                             :priority => e.priority
79
      end
80
      # Check if parametrized value of container matches Docker API's expectations
81
      assert @container.parametrize.key? "HostConfig"
82
      assert @container.parametrize["HostConfig"].key? "Dns"
83
      assert @container.parametrize["HostConfig"].value? ["18.18.18.18", "19.19.19.19"]
84
    end
62 85
  end
63 86
end

Also available in: Unified diff