blob: 59e0fba31953fe5d7c2abef89bfb5795d391b3ee [file] [log] [blame]
Marco Millerb4510672021-01-21 13:09:34 -05001#!/bin/bash
2#
3# Example usage only-
4# 1. Optional: replace test@mail.com below with your own, reachable locally.
5# 2. Use the '>>' operator below instead to not overwrite your known_hosts; keep '>' otherwise.
6# 3. Note that appending as proposed above may potentially repeat the same line multiple times.
7# 4. Init your local Gerrit test site then start it; you may refer to [1] below.
8# 5. Set GIT_HTTP_PASSWORD below to yours, from [2].
9# 6. Change to this directory to execute ./README (this executable file) in its own terminal.
10# 7. Install sbt if missing, based on your operating system; re-run to compile.
11# 8. Optional: add the below generated (displayed) key to your local admin user [3].
12# 9. Otherwise keep the lines below that use your existing user ssh keys for admin testing.
13# 10. This script assumes the google-sourced version of the example json file [4].
14# 11. If running that scenario locally as below reports authentication failures, [4] may be a fork.
15# 12. Uncomment any one of the below sbt commands at will; you may add some locally.
16# 13. See [5] for how to start using JAVA_OPTS below; you may leave it empty for these sbt commands.
17# 14. You can initialize an IDE sbt (Scala) project from/in this root folder; see [6].
18#
19# [1] https://gerrit-review.googlesource.com/Documentation/dev-readme.html#init
20# [2] http://localhost:8080/settings/#HTTPCredentials
21# [3] http://localhost:8080/settings/#SSHKeys
22# [4] ./src/test/resources/data/com/google/gerrit/scenarios/CloneUsingBothProtocols.json
23# [5] https://gerrit-review.googlesource.com/Documentation/dev-e2e-tests.html#_environment_properties
24# [6] https://gerrit-review.googlesource.com/Documentation/dev-e2e-tests.html#_ide_intellij
25
26# DO NOT change this (assumed) directory; force-removed *recursively* below!
27gatlingGitKeys=/tmp/ssh-keys
28
29userSshDir=$HOME/.ssh
30
31# Comment this group of lines out if willing to generate other keys as below.
32rm -f $gatlingGitKeys
33ln -s "$userSshDir" $gatlingGitKeys
34
35# Comment this group of lines out if keys already generated, as either below or above.
36#rm -fr $gatlingGitKeys
37#mkdir $gatlingGitKeys
38#ssh-keygen -m PEM -t rsa -C "test@mail.com" -f $gatlingGitKeys/id_rsa
39
40ssh-keyscan -t rsa -p 29418 localhost > "$userSshDir"/known_hosts
41cat $gatlingGitKeys/id_rsa.pub
42
43export GIT_HTTP_USERNAME="admin"
44export GIT_HTTP_PASSWORD="TODO"
45export JAVA_OPTS="\
46"
47#-Dx=y \
48
49#sbt clean
50#sbt update
51sbt compile
52#sbt "gatling:testOnly com.google.gerrit.scenarios.CloneUsingBothProtocols"
53#sbt "gatling:lastReport"