Commit 578a98fb authored by Lin Jen-Shin's avatar Lin Jen-Shin

Save host-verification test against SHA1 checksum

parent 09a3b8fb
require 'digest/sha1'
module QA
feature 'pull codes with a deploy key', :core, :docker do
let(:runner_name) { "qa-runner-#{Time.now.to_i}" }
......@@ -43,19 +45,25 @@ module QA
repository_location
end
repository_uri = URI.parse(repository_url)
gitlab_ci =
<<~YAML
cat-config:
script:
- mkdir -p ~/.ssh
- ssh-keyscan -p #{repository_uri.port} #{repository_uri.host} >> ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$DEPLOY_KEY" | tr -d '\\r' | ssh-add - > /dev/null
- echo "$DEPLOY_KEY" | ssh-add -
- git clone #{repository_url}
- cat #{project.name}/.gitlab-ci.yml
- sha1sum #{project.name}/.gitlab-ci.yml
tags:
- qa
- docker
YAML
sha1sum = Digest::SHA1.hexdigest(gitlab_ci)
Factory::Repository::Push.fabricate! do |push|
push.project = project
push.file_name = '.gitlab-ci.yml'
......@@ -76,7 +84,7 @@ module QA
end
Page::Project::Job::Show.perform do |job|
expect(job.output).to include(gitlab_ci.tr("\n", ' '))
expect(job.output).to include(sha1sum)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment