gitlab-qa 15.10.1 → 15.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/docs/what_tests_can_be_run.md +3 -0
- data/lib/gitlab/qa/scenario/test/instance/airgapped.rb +34 -3
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 84dd5f52a5315b76b1fddcf578afa77b71699744f6c9250edd82c103a74c8e66
|
|
4
|
+
data.tar.gz: a6abb8d04101eac27f5289e705d54f257ca2bad9e451b039c53e9fbc86621509
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a78f8366d7779dc733b81cbde2a6ca07ca3241558424a8b3a3a1944909eeafcebd7c0e942a5d9aadccc461a0f8d7e6ccce6a597b36f2dab39c041d94075d7662
|
|
7
|
+
data.tar.gz: 80b60afd84ec9b1d9aeb470b89cccb97d92d2086ee2c5658446d8db166c52457ad9e438c831a1358a1bc57b8c41d8562b226af01e1a3c0db933ef7365e2e0a06
|
data/Gemfile.lock
CHANGED
|
@@ -1008,6 +1008,9 @@ This scenario will run tests from the test suite against an airgapped instance.
|
|
|
1008
1008
|
The airgapped instance is set up by using `iptables` in the GitLab container to block network traffic other than testable ports, and by using runners
|
|
1009
1009
|
in a shared internal network.
|
|
1010
1010
|
|
|
1011
|
+
After the rules are applied, the job fails if the container can connect to gitlab.com on port 443, to example.com on port 80 or 443, or to dns.google on port 53.
|
|
1012
|
+
The job also logs whether gitlab.com port 8080 is reachable, which the rules allow, and how many packets the `OUTPUT` policy dropped. Neither log line fails the job.
|
|
1013
|
+
|
|
1011
1014
|
Example:
|
|
1012
1015
|
|
|
1013
1016
|
```shell
|
|
@@ -39,6 +39,7 @@ module Gitlab
|
|
|
39
39
|
rspec_args << "--" unless rspec_args.include?('--')
|
|
40
40
|
rspec_args << "--tag ~orchestrated"
|
|
41
41
|
gitlab.instance do
|
|
42
|
+
report_gitlab_port_8080(gitlab)
|
|
42
43
|
Component::Specs.perform do |specs|
|
|
43
44
|
specs.suite = 'Test::Instance::Airgapped'
|
|
44
45
|
specs.release = gitlab.release
|
|
@@ -46,14 +47,42 @@ module Gitlab
|
|
|
46
47
|
specs.runner_network = gitlab.runner_network
|
|
47
48
|
specs.args = [gitlab.address, *rspec_args]
|
|
48
49
|
end
|
|
50
|
+
ensure
|
|
51
|
+
report_dropped_packets(gitlab)
|
|
49
52
|
end
|
|
50
53
|
end
|
|
51
54
|
end
|
|
52
55
|
|
|
53
56
|
private
|
|
54
57
|
|
|
58
|
+
def report_dropped_packets(gitlab)
|
|
59
|
+
chain = gitlab.docker.exec(gitlab.name, 'iptables -nvxL OUTPUT')
|
|
60
|
+
Runtime::Logger.info("Airgapped packets dropped by the OUTPUT policy: #{chain[/policy DROP \d+ packets, \d+ bytes/]}")
|
|
61
|
+
rescue Support::ShellCommand::StatusError => e
|
|
62
|
+
Runtime::Logger.warn("Unable to read the airgapped OUTPUT chain counters: #{e.message}")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def report_gitlab_port_8080(gitlab)
|
|
66
|
+
address = Resolv.getaddress('gitlab.com')
|
|
67
|
+
state = gitlab.docker.exec(gitlab.name, "ncat -zv -w 10 #{address} 8080 > /dev/null 2>&1 && echo open || echo closed")
|
|
68
|
+
if state.include?('open')
|
|
69
|
+
Runtime::Logger.warn("Airgapped finding: gitlab.com port 8080 is reachable")
|
|
70
|
+
else
|
|
71
|
+
Runtime::Logger.info("Airgapped gitlab.com port 8080 is not reachable")
|
|
72
|
+
end
|
|
73
|
+
rescue Resolv::ResolvError, Support::ShellCommand::StatusError => e
|
|
74
|
+
Runtime::Logger.warn("Unable to probe gitlab.com port 8080: #{e.message}")
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def unreachable_check(ip, port)
|
|
78
|
+
reachable = "echo 'Airgapped network faulty. #{ip} port #{port} is reachable.'; exit 1;"
|
|
79
|
+
"if ncat -zv -w 10 #{ip} #{port}; then #{reachable} else echo 'Airgapped connectivity #{ip} port #{port} check passed.'; fi;"
|
|
80
|
+
end
|
|
81
|
+
|
|
55
82
|
def airgap_gitlab_commands
|
|
56
83
|
gitlab_ip = Resolv.getaddress('gitlab.com')
|
|
84
|
+
outside_ip = Resolv.getaddress('example.com')
|
|
85
|
+
resolver_ip = Resolv.getaddress('dns.google')
|
|
57
86
|
gitlab_registry_ip = Resolv.getaddress(QA::Release::COM_REGISTRY)
|
|
58
87
|
dev_gitlab_registry_ip = Resolv.getaddress(QA::Release::DEV_REGISTRY.split(':')[0])
|
|
59
88
|
praefect_ip = config.praefect_ip
|
|
@@ -62,6 +91,7 @@ module Gitlab
|
|
|
62
91
|
# Ping and wget check
|
|
63
92
|
apt-get update && apt-get install -y iptables ncat
|
|
64
93
|
if ncat -zv -w 10 #{gitlab_ip} 80; then echo 'Airgapped connectivity check passed.'; else echo 'Airgapped connectivity check failed - should be able to access gitlab_ip'; exit 1; fi;
|
|
94
|
+
if ncat -zv -w 10 #{outside_ip} 443; then echo 'Airgapped connectivity outside_ip check passed.'; else echo 'Airgapped connectivity check failed - should be able to access outside_ip'; exit 1; fi;
|
|
65
95
|
|
|
66
96
|
echo "Checking regular connectivity..." \
|
|
67
97
|
&& wget --retry-connrefused --waitretry=1 --read-timeout=15 --timeout=10 -t 2 http://registry.gitlab.com > /dev/null 2>&1 \
|
|
@@ -92,9 +122,10 @@ module Gitlab
|
|
|
92
122
|
if ncat -zv -w 10 127.0.0.1 80; then echo 'Airgapped connectivity port 80 check passed.'; else echo 'Airgapped connectivity port 80 check failed.'; exit 1 ; fi;
|
|
93
123
|
if ncat -zv -w 10 #{gitlab_registry_ip} 80; then echo 'Airgapped connectivity port gitlab_registry_ip check passed.'; else echo 'Airgapped connectivity port 80 check failed.'; exit 1; fi;
|
|
94
124
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
125
|
+
#{unreachable_check(gitlab_ip, 443)}
|
|
126
|
+
#{unreachable_check(outside_ip, 80)}
|
|
127
|
+
#{unreachable_check(outside_ip, 443)}
|
|
128
|
+
#{unreachable_check(resolver_ip, 53)}
|
|
98
129
|
AIRGAP_AND_VERIFY_COMMAND
|
|
99
130
|
end
|
|
100
131
|
|
data/lib/gitlab/qa/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab-qa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 15.10.
|
|
4
|
+
version: 15.10.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GitLab Quality
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: climate_control
|