diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 06:52:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 06:52:35 +0000 |
commit | a9cb06be0d956f10f95c107e930d8ace2cb3722d (patch) | |
tree | 1f4b4337c7e867dd6701196b93cfa2cfb64aa868 | |
parent | b06b9b0de6b9372354da7f241a54260d2b7b1aa1 (diff) | |
download | gitlab-ce-a9cb06be0d956f10f95c107e930d8ace2cb3722d.tar.gz |
Add latest changes from gitlab-org/gitlab@14-1-stable-ee
5 files changed, 44 insertions, 32 deletions
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/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 8e03444b113..912d10dfa7d 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 3702f95158c..9208d412c0f 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 a8650d633c8..ab14098124a 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/6_release/deploy_key/clone_using_deploy_key_spec.rb b/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb index 8e61ec4d2d7..f4a5c715684 100644 --- a/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb +++ b/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb @@ -5,27 +5,31 @@ require 'digest/sha1' module QA RSpec.describe 'Release', :runner do describe 'Git clone using a deploy key' do - before do - Flow::Login.sign_in - - @runner_name = "qa-runner-#{Time.now.to_i}" + let(:runner_name) { "qa-runner-#{SecureRandom.hex(4)}" } + let(:repository_location) { project.repository_ssh_location } - @project = Resource::Project.fabricate_via_api! do |project| + let(:project) do + Resource::Project.fabricate_via_api! do |project| project.name = 'deploy-key-clone-project' end + end - @repository_location = @project.repository_ssh_location - - @runner = Resource::Runner.fabricate_via_api! do |resource| - resource.project = @project - resource.name = @runner_name - resource.tags = %w[qa docker] + let!(:runner) do + Resource::Runner.fabricate_via_api! do |resource| + resource.project = project + resource.name = runner_name + resource.tags = [runner_name] resource.image = 'gitlab/gitlab-runner:alpine' end end + before do + Flow::Login.sign_in + end + after do - @runner.remove_via_api! + runner.remove_via_api! + project.remove_via_api! end keys = [ @@ -39,7 +43,7 @@ module QA key = key_class.new(*bits) Resource::DeployKey.fabricate_via_browser_ui! do |resource| - resource.project = @project + resource.project = project resource.title = "deploy key #{key.name}(#{key.bits})" resource.key = key.public_key end @@ -49,25 +53,23 @@ module QA make_ci_variable(deploy_key_name, key) gitlab_ci = <<~YAML - cat-config: - script: - - apk add --update --no-cache openssh-client - - mkdir -p ~/.ssh - - ssh-keyscan -p #{@repository_location.port} #{@repository_location.host} >> ~/.ssh/known_hosts - - eval $(ssh-agent -s) - - ssh-add -D - - echo "$#{deploy_key_name}" | ssh-add - - - git clone #{@repository_location.git_uri} - - cd #{@project.name} - - git checkout #{deploy_key_name} - - sha1sum .gitlab-ci.yml - tags: - - qa - - docker + cat-config: + script: + - which ssh-agent || ( apk --update add openssh-client ) + - mkdir -p ~/.ssh + - ssh-keyscan -p #{repository_location.port} #{repository_location.host} >> ~/.ssh/known_hosts + - eval $(ssh-agent -s) + - ssh-add -D + - echo "$#{deploy_key_name}" | ssh-add - + - git clone #{repository_location.git_uri} + - cd #{project.name} + - git checkout #{deploy_key_name} + - sha1sum .gitlab-ci.yml + tags: [#{runner_name}] YAML Resource::Repository::ProjectPush.fabricate! do |resource| - resource.project = @project + resource.project = project resource.file_name = '.gitlab-ci.yml' resource.commit_message = 'Add .gitlab-ci.yml' resource.file_content = gitlab_ci @@ -81,8 +83,10 @@ module QA Page::Project::Pipeline::Show.perform(&:click_on_first_job) Page::Project::Job::Show.perform do |job| - expect(job).to be_successful - expect(job.output).to include(sha1sum) + aggregate_failures 'job succeeds and has correct sha1sum' do + expect(job).to be_successful + expect(job.output).to include(sha1sum) + end end end @@ -90,7 +94,7 @@ module QA def make_ci_variable(key_name, key) Resource::CiVariable.fabricate_via_api! do |resource| - resource.project = @project + resource.project = project resource.key = key_name resource.value = key.private_key resource.masked = false |