summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2018-09-12 12:40:49 -0400
committerMark Lapierre <mlapierre@gitlab.com>2018-09-12 12:40:49 -0400
commit04442414a6069aee7d88711776d3ff1a7c5924ca (patch)
treeb5c49a6328406f115bcd1734167bb993edb969dd
parent40e95746247a70112b4676e2ed44e11bb0f995fa (diff)
downloadgitlab-ce-ml-qa-ssh-spec-no-deploy-key.tar.gz
Test without the deploy key specml-qa-ssh-spec-no-deploy-key
-rw-r--r--qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb109
-rw-r--r--qa/qa/specs/features/project/add_ssh_key_spec.rb29
-rw-r--r--qa/qa/specs/features/project/use_ssh_key_spec.rb38
3 files changed, 0 insertions, 176 deletions
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
deleted file mode 100644
index 8352d13b06d..00000000000
--- a/qa/qa/specs/features/browser_ui/6_release/deploy_key/clone_using_deploy_key_spec.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-# frozen_string_literal: true
-
-require 'digest/sha1'
-
-module QA
- context :release, :docker do
- describe 'Git clone using a deploy key' do
- def login
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
- end
-
- before(:all) do
- login
-
- @runner_name = "qa-runner-#{Time.now.to_i}"
-
- @project = Factory::Resource::Project.fabricate! do |resource|
- resource.name = 'deploy-key-clone-project'
- end
-
- @repository_location = @project.repository_ssh_location
-
- Factory::Resource::Runner.fabricate! do |resource|
- resource.project = @project
- resource.name = @runner_name
- resource.tags = %w[qa docker]
- resource.image = 'gitlab/gitlab-runner:ubuntu'
- end
-
- Page::Menu::Main.act { sign_out }
- end
-
- after(:all) do
- Service::Runner.new(@runner_name).remove!
- end
-
- keys = [
- [Runtime::Key::RSA, 8192],
- [Runtime::Key::ECDSA, 521],
- [Runtime::Key::ED25519]
- ]
-
- keys.each do |(key_class, bits)|
- it "user sets up a deploy key with #{key_class}(#{bits}) to clone code using pipelines" do
- key = key_class.new(*bits)
-
- login
-
- Factory::Resource::DeployKey.fabricate! do |resource|
- resource.project = @project
- resource.title = "deploy key #{key.name}(#{key.bits})"
- resource.key = key.public_key
- end
-
- deploy_key_name = "DEPLOY_KEY_#{key.name}_#{key.bits}"
-
- Factory::Resource::SecretVariable.fabricate! do |resource|
- resource.project = @project
- resource.key = deploy_key_name
- resource.value = key.private_key
- end
-
- gitlab_ci = <<~YAML
- cat-config:
- script:
- - 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
- YAML
-
- Factory::Repository::ProjectPush.fabricate! do |resource|
- resource.project = @project
- resource.file_name = '.gitlab-ci.yml'
- resource.commit_message = 'Add .gitlab-ci.yml'
- resource.file_content = gitlab_ci
- resource.branch_name = deploy_key_name
- resource.new_branch = true
- end
-
- sha1sum = Digest::SHA1.hexdigest(gitlab_ci)
-
- Page::Project::Show.act { wait_for_push }
- Page::Menu::Side.act { click_ci_cd_pipelines }
- Page::Project::Pipeline::Index.act { go_to_latest_pipeline }
- Page::Project::Pipeline::Show.act { go_to_first_job }
-
- Page::Project::Job::Show.perform do |job|
- job.wait(reload: false) do
- job.completed? && !job.trace_loading?
- end
-
- expect(job.passed?).to be_truthy, "Job status did not become \"passed\"."
- expect(job.output).to include(sha1sum)
- end
- end
- end
- end
- end
-end
diff --git a/qa/qa/specs/features/project/add_ssh_key_spec.rb b/qa/qa/specs/features/project/add_ssh_key_spec.rb
deleted file mode 100644
index 63fea3205dd..00000000000
--- a/qa/qa/specs/features/project/add_ssh_key_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- describe 'SSH keys support', :core do
- let(:key_title) { "key for ssh tests #{Time.now.to_f}" }
-
- it 'user adds and then removes an SSH key' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- key = Factory::Resource::SSHKey.fabricate! do |resource|
- resource.title = key_title
- end
-
- expect(page).to have_content("Title: #{key_title}")
- expect(page).to have_content(key.fingerprint)
-
- Page::Menu::Main.act { go_to_profile_settings }
- Page::Menu::Profile.act { click_ssh_keys }
-
- Page::Profile::SSHKeys.perform do |ssh_keys|
- ssh_keys.remove_key(key_title)
- end
-
- expect(page).not_to have_content("Title: #{key_title}")
- expect(page).not_to have_content(key.fingerprint)
- end
- end
-end
diff --git a/qa/qa/specs/features/project/use_ssh_key_spec.rb b/qa/qa/specs/features/project/use_ssh_key_spec.rb
deleted file mode 100644
index 8fccb51e879..00000000000
--- a/qa/qa/specs/features/project/use_ssh_key_spec.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- describe 'SSH key support', :core do
- # Note: If you run this test against GDK make sure you've enabled sshd by
- # uncommenting the 'sshd' line in your Procfile
-
- let(:key_title) { "key for ssh tests #{Time.now.to_f}" }
-
- it 'user adds an ssh key and pushes code to the repository' do
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.act { sign_in_using_credentials }
-
- key = Factory::Resource::SSHKey.fabricate! do |resource|
- resource.title = key_title
- end
-
- Factory::Repository::ProjectPush.fabricate! do |push|
- push.ssh_key = key
- push.file_name = 'README.md'
- push.file_content = '# Test Use SSH Key'
- push.commit_message = 'Add README.md'
- end
-
- Page::Project::Show.act { wait_for_push }
-
- expect(page).to have_content('README.md')
- expect(page).to have_content('Test Use SSH Key')
-
- Page::Menu::Main.act { go_to_profile_settings }
- Page::Menu::Profile.act { click_ssh_keys }
-
- Page::Profile::SSHKeys.perform do |ssh_keys|
- ssh_keys.remove_key(key_title)
- end
- end
- end
-end