Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2c50eba2
Commit
2c50eba2
authored
Jul 16, 2021
by
Sofia Vistas
Committed by
Ramya Authappan
Jul 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
End to end test for the Self managed Registry
parent
5a4ba3d7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
119 additions
and
3 deletions
+119
-3
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+4
-0
qa/qa/scenario/test/integration/registry.rb
qa/qa/scenario/test/integration/registry.rb
+13
-0
qa/qa/service/docker_run/gitlab_runner.rb
qa/qa/service/docker_run/gitlab_runner.rb
+13
-3
qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb
...s/browser_ui/5_package/container_registry_omnibus_spec.rb
+88
-0
No files found.
qa/qa.rb
View file @
2c50eba2
...
...
@@ -171,6 +171,7 @@ module QA
autoload
:ObjectStorage
,
'qa/scenario/test/integration/object_storage'
autoload
:SMTP
,
'qa/scenario/test/integration/smtp'
autoload
:SSHTunnel
,
'qa/scenario/test/integration/ssh_tunnel'
autoload
:Registry
,
'qa/scenario/test/integration/registry'
end
module
Sanity
...
...
qa/qa/runtime/env.rb
View file @
2c50eba2
...
...
@@ -396,6 +396,10 @@ module QA
ENV
.
fetch
(
'GITLAB_QA_TRANSIENT_TRIALS'
,
10
).
to_i
end
def
gitlab_tls_certificate
ENV
[
'GITLAB_TLS_CERTIFICATE'
]
end
private
def
remote_grid_credentials
...
...
qa/qa/scenario/test/integration/registry.rb
0 → 100644
View file @
2c50eba2
# frozen_string_literal: true
module
QA
module
Scenario
module
Test
module
Integration
class
Registry
<
Test
::
Instance
::
All
tags
:registry
end
end
end
end
end
qa/qa/service/docker_run/gitlab_runner.rb
View file @
2c50eba2
...
...
@@ -38,11 +38,10 @@ module QA
def
register!
shell
<<~
CMD
.
tr
(
"
\n
"
,
' '
)
docker run -d --rm --entrypoint=/bin/sh
--network
#{
runner_network
}
--name
#{
@name
}
docker run -d --rm --network
#{
runner_network
}
--name
#{
@name
}
#{
'-v /var/run/docker.sock:/var/run/docker.sock'
if
@executor
==
:docker
}
--privileged
#{
@image
}
-c "
#{
register_command
}
"
#{
@image
}
#{
add_gitlab_tls_cert
if
@address
.
include?
"https"
}
&& docker exec --detach
#{
@name
}
sh
-c "
#{
register_command
}
"
CMD
# Prove airgappedness
...
...
@@ -82,6 +81,7 @@ module QA
args
<<
'--docker-tlsverify=false'
args
<<
'--docker-privileged=true'
args
<<
"--docker-network-mode=
#{
network
}
"
args
<<
"--docker-volumes=/certs/client"
end
<<~
CMD
.
strip
...
...
@@ -102,6 +102,16 @@ module QA
wget --retry-connrefused --waitretry=1 --read-timeout=15 --timeout=10 -t 2 http://registry.gitlab.com > /dev/null 2>&1 && (echo "Airgapped network faulty. Connectivity wget check failed." && exit 1) || (echo "Airgapped network confirmed. Connectivity wget check passed." && exit 0)
CMD
end
def
add_gitlab_tls_cert
gitlab_tls_certificate
=
Tempfile
.
new
(
'gitlab-cert'
)
gitlab_tls_certificate
.
write
(
Runtime
::
Env
.
gitlab_tls_certificate
)
gitlab_tls_certificate
.
close
<<~
CMD
&& docker cp
#{
gitlab_tls_certificate
.
path
}
#{
@name
}
:/etc/gitlab-runner/certs/gitlab.test.crt
CMD
end
end
end
end
...
...
qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb
0 → 100644
View file @
2c50eba2
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Package'
,
:registry
,
:orchestrated
do
describe
'Self-managed Container Registry'
do
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-with-registry'
project
.
template_name
=
'express'
end
end
let!
(
:runner
)
do
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
name
=
"qa-runner-
#{
Time
.
now
.
to_i
}
"
runner
.
tags
=
[
"runner-for-
#{
project
.
name
}
"
]
runner
.
executor
=
:docker
runner
.
project
=
project
end
end
before
do
Flow
::
Login
.
sign_in
project
.
visit!
end
after
do
runner
.
remove_via_api!
end
it
"pushes image and deletes tag"
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1743'
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
([{
file_path:
'.gitlab-ci.yml'
,
content:
<<~
YAML
build:
image: docker:19.03.12
stage: build
services:
- name: docker:19.03.12-dind
command:
- /bin/sh
- -c
- |
apk add --no-cache openssl
true | openssl s_client -showcerts -connect gitlab.test:5050 > /usr/local/share/ca-certificates/gitlab.test.crt
update-ca-certificates
dockerd-entrypoint.sh || exit
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD gitlab.test:5050
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
tags:
- "runner-for-
#{
project
.
name
}
"
YAML
}])
end
Flow
::
Pipeline
.
visit_latest_pipeline
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'build'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
800
)
end
Page
::
Project
::
Menu
.
perform
(
&
:go_to_container_registry
)
Page
::
Project
::
Registry
::
Show
.
perform
do
|
registry
|
expect
(
registry
).
to
have_registry_repository
(
project
.
path_with_namespace
)
registry
.
click_on_image
(
project
.
path_with_namespace
)
expect
(
registry
).
to
have_tag
(
'master'
)
registry
.
click_delete
expect
(
registry
).
not_to
have_tag
(
'master'
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment