diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-26 18:36:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-26 18:36:39 +0300 |
commit | ee9fd5d06a5ad8fa2d8f0b59614af63eb1b732c3 (patch) | |
tree | 4a10df7aa7944e9fa5139df650f65419b3773ca6 /qa | |
parent | 11657a33e97a26f699638ab26ef934c8298126b7 (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-ee
Diffstat (limited to 'qa')
8 files changed, 126 insertions, 57 deletions
@@ -50,7 +50,8 @@ module QA "user_gpg" => "UserGPG", "smtp" => "SMTP", "otp" => "OTP", - "jira_api" => "JiraAPI" + "jira_api" => "JiraAPI", + "registry_tls" => "RegistryTLS" ) loader.setup diff --git a/qa/qa/page/profile/two_factor_auth.rb b/qa/qa/page/profile/two_factor_auth.rb index a0dd230d8ab..63593bf0482 100644 --- a/qa/qa/page/profile/two_factor_auth.rb +++ b/qa/qa/page/profile/two_factor_auth.rb @@ -11,6 +11,7 @@ module QA view 'app/views/profiles/two_factor_auths/show.html.haml' do element :otp_secret_content element :pin_code_field + element :current_password_field element :register_2fa_app_button end @@ -33,6 +34,10 @@ module QA fill_element(:pin_code_field, pin_code) end + def set_current_password(password) + fill_element(:current_password_field, password) + end + def click_register_2fa_app_button click_element :register_2fa_app_button end diff --git a/qa/qa/scenario/test/integration/registry_tls.rb b/qa/qa/scenario/test/integration/registry_tls.rb new file mode 100644 index 00000000000..4e9d6b6ea97 --- /dev/null +++ b/qa/qa/scenario/test/integration/registry_tls.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module QA + module Scenario + module Test + module Integration + class RegistryTLS < Test::Instance::All + tags :registry_tls + end + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb index a3235543998..4e15aa79623 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_recovery_spec.rb @@ -78,6 +78,7 @@ module QA @otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content) two_fa_auth.set_pin_code(@otp.fresh_otp) + two_fa_auth.set_current_password(user.password) two_fa_auth.click_register_2fa_app_button recovery_code = two_fa_auth.recovery_codes.sample diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb index 8a2bbc92eca..b97da194795 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/2fa_ssh_recovery_spec.rb @@ -55,6 +55,7 @@ module QA Page::Profile::TwoFactorAuth.perform do |two_fa_auth| otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content) two_fa_auth.set_pin_code(otp.fresh_otp) + two_fa_auth.set_current_password(user.password) two_fa_auth.click_register_2fa_app_button two_fa_auth.click_copy_and_proceed end diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb index 2fe1cbabee3..78fbec594a3 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_with_2fa_spec.rb @@ -98,6 +98,7 @@ module QA @otp = QA::Support::OTP.new(two_fa_auth.otp_secret_content) two_fa_auth.set_pin_code(@otp.fresh_otp) + two_fa_auth.set_current_password(user.password) two_fa_auth.click_register_2fa_app_button two_fa_auth.click_copy_and_proceed diff --git a/qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb b/qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb index 3d02c2884a2..ffc76204731 100644 --- a/qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/container_registry_omnibus_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Package', :registry, :orchestrated, only: { pipeline: :main } do + RSpec.describe 'Package', :orchestrated, only: { pipeline: :main } do describe 'Self-managed Container Registry' do let(:project) do Resource::Project.fabricate_via_api! do |project| @@ -28,59 +28,112 @@ module QA runner.remove_via_api! end - it "pushes image and deletes tag", testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1911' 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 + context 'when tls is enabled' do + it "pushes image and deletes tag", :registry_tls, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1911' 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 + Flow::Pipeline.visit_latest_pipeline - Page::Project::Pipeline::Show.perform do |pipeline| - pipeline.click_job('build') - end + 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') - Page::Project::Job::Show.perform do |job| - expect(job).to be_successful(timeout: 800) + registry.click_delete + expect(registry).not_to have_tag('master') + end end + end + + context "when tls is disabled" do + it "pushes image and deletes tag", :registry, testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/2378' 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: ["--insecure-registry=gitlab.test:5050"] + 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::Menu.perform(&:go_to_container_registry) - Page::Project::Registry::Show.perform do |registry| - expect(registry).to have_registry_repository(project.path_with_namespace) + 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_on_image(project.path_with_namespace) + expect(registry).to have_tag('master') - registry.click_delete - expect(registry).not_to have_tag('master') + registry.click_delete + expect(registry).not_to have_tag('master') + end end end end diff --git a/qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb b/qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb index bfcc49885a0..9879b12e1c2 100644 --- a/qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/dependency_proxy_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - RSpec.describe 'Package', :orchestrated, :registry do + RSpec.describe 'Package', :orchestrated, :registry, only: { pipeline: :main } do describe 'Dependency Proxy' do let(:project) do Resource::Project.fabricate_via_api! do |project| @@ -56,17 +56,11 @@ module QA image: "#{docker_client_version}" services: - name: "#{docker_client_version}-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 + command: ["--insecure-registry=gitlab.test:80"] before_script: - apk add curl jq grep - - docker login -u "$CI_DEPENDENCY_PROXY_USER" -p "$CI_DEPENDENCY_PROXY_PASSWORD" "$CI_DEPENDENCY_PROXY_SERVER" + - echo $CI_DEPENDENCY_PROXY_SERVER + - docker login -u "$CI_DEPENDENCY_PROXY_USER" -p "$CI_DEPENDENCY_PROXY_PASSWORD" gitlab.test:80 script: - docker pull #{dependency_proxy_url}/alpine:latest - TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq --raw-output .token) |