Class: Gitlab::QA::Component::MockServer
- Defined in:
- lib/gitlab/qa/component/mock_server.rb
Overview
General purpose http mock server see: smocker.dev/
Constant Summary collapse
- DOCKER_IMAGE =
"thiht/smocker"
- DOCKER_IMAGE_TAG =
"0.18.2"
Constants inherited from Base
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tls ⇒ Object
writeonly
Sets the attribute tls.
Attributes inherited from Base
#additional_hosts, #airgapped_network, #docker, #environment, #network, #network_aliases, #ports, #runner_network, #volumes
Instance Method Summary collapse
-
#initialize ⇒ MockServer
constructor
A new instance of MockServer.
- #prepare ⇒ Object
Methods inherited from Base
#add_network_alias, #hostname, #image, #instance, #ip_address, #prepare_airgapped_network, #prepare_docker_container, #prepare_docker_image, #prepare_network, #prepare_runner_network, #process_exec_commands, #pull, #restart, #start, #start_instance, #tag, #teardown, #teardown!
Methods included from Scenario::Actable
Constructor Details
#initialize ⇒ MockServer
Returns a new instance of MockServer.
13 14 15 16 17 18 19 20 21 |
# File 'lib/gitlab/qa/component/mock_server.rb', line 13 def initialize super @tls = false @name = "smocker" @tls_path = "/etc/smocker/tls" @ports = [80, 8081] @environment = { "SMOCKER_MOCK_SERVER_LISTEN_PORT" => 80 } end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/gitlab/qa/component/mock_server.rb', line 23 def name @name end |
#tls=(value) ⇒ Object
Sets the attribute tls
24 25 26 |
# File 'lib/gitlab/qa/component/mock_server.rb', line 24 def tls=(value) @tls = value end |
Instance Method Details
#prepare ⇒ Object
26 27 28 29 30 |
# File 'lib/gitlab/qa/component/mock_server.rb', line 26 def prepare super setup_tls if tls end |