Marco Miller | b451067 | 2021-01-21 13:09:34 -0500 | [diff] [blame] | 1 | #!/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! |
| 27 | gatlingGitKeys=/tmp/ssh-keys |
| 28 | |
| 29 | userSshDir=$HOME/.ssh |
| 30 | |
| 31 | # Comment this group of lines out if willing to generate other keys as below. |
| 32 | rm -f $gatlingGitKeys |
| 33 | ln -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 | |
| 40 | ssh-keyscan -t rsa -p 29418 localhost > "$userSshDir"/known_hosts |
| 41 | cat $gatlingGitKeys/id_rsa.pub |
| 42 | |
| 43 | export GIT_HTTP_USERNAME="admin" |
| 44 | export GIT_HTTP_PASSWORD="TODO" |
| 45 | export JAVA_OPTS="\ |
| 46 | " |
| 47 | #-Dx=y \ |
| 48 | |
| 49 | #sbt clean |
| 50 | #sbt update |
| 51 | sbt compile |
| 52 | #sbt "gatling:testOnly com.google.gerrit.scenarios.CloneUsingBothProtocols" |
| 53 | #sbt "gatling:lastReport" |