summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2014-05-17 10:18:17 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2014-05-17 10:18:17 +0100
commit5f1429e7747cb62ecdd30297d489fba52a1cdfa0 (patch)
treebdd6fe67270b75ff84b584af2f98d9769d6f9813
parenta5f2e7debbbf35ceeeca33bc35db0596c8ed814f (diff)
downloadgitano-5f1429e7747cb62ecdd30297d489fba52a1cdfa0.tar.bz2
Add support for cached ssh keys for testing. Shaves 20% off test runtime
-rw-r--r--testing/gitano-test-tool.in28
-rw-r--r--testing/keys/alice@main_rsa27
-rw-r--r--testing/keys/alice@main_rsa.pub1
-rw-r--r--testing/keys/testinstance@adminkey_rsa27
-rw-r--r--testing/keys/testinstance@adminkey_rsa.pub1
-rw-r--r--testing/keys/testinstance@other_rsa27
-rw-r--r--testing/keys/testinstance@other_rsa.pub1
7 files changed, 106 insertions, 6 deletions
diff --git a/testing/gitano-test-tool.in b/testing/gitano-test-tool.in
index 1a04b31..e892474 100644
--- a/testing/gitano-test-tool.in
+++ b/testing/gitano-test-tool.in
@@ -109,12 +109,28 @@ end
function cmd_createsshkey(username, keyname, optionaltype)
optionaltype = optionaltype or "rsa"
- run_program {
- "ssh-keygen", "-q",
- "-t", optionaltype,
- "-C", username .. "-" .. optionaltype .. "@" .. keyname,
- "-f", ssh_key_file(username, keyname),
- "-N", "" }
+ local targetkey = ssh_key_file(username, keyname)
+ local sourcekey = table.concat {
+ "testing/keys/", username, "@", keyname, "_", optionaltype }
+ local fh = io.open(sourcekey, "r")
+ if not fh then
+ run_program {
+ "ssh-keygen", "-q",
+ "-t", optionaltype,
+ "-C", username .. "-" .. optionaltype .. "@" .. keyname,
+ "-f", sourcekey,
+ "-N", "" }
+ fh = assert(io.open(sourcekey, "r"))
+ end
+ local ofh = assert(io.open(targetkey, "w"))
+ ofh:write(fh:read("*a"))
+ fh:close()
+ ofh:close()
+ fh = assert(io.open(sourcekey .. ".pub", "r"))
+ ofh = assert(io.open(targetkey .. ".pub", "w"))
+ ofh:write(fh:read("*a"))
+ fh:close()
+ ofh:close()
end
function cmd_setupstandard(owning_user, master_key)
diff --git a/testing/keys/alice@main_rsa b/testing/keys/alice@main_rsa
new file mode 100644
index 0000000..2533124
--- /dev/null
+++ b/testing/keys/alice@main_rsa
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEArgw+4pBPFz7BVbdBtdkKo9TZ3fjnEu8pn+FLp5UpYiQJpIIG
+DG5wDxZAb/ZrP2gL+Ay3vW9UDrRYoC80fCXpxZ5iqz+EEFj1jtrJJEGqR19oByNk
+/CCcb9dmiFwvI9Spd5iC2HXqV8JoCX4cziyo349FB55ljuk+ZOLRTn9dRbU0fJU3
+W4GFpTmNY5jBAb2fPfDFHEuQ2ClzlCDmRq7mhdnUqF7/IFcoo9DonWnl5GOzgGzX
+Kr2fzVV8cYZmAO1fPQ/ODLqny1iEYxccDWMJfJMsUMHePKwS7HMntpgyIBLFuzxy
+wVCr0141Iqn5nn8URxaMTT6631o6xs2PiMWSnwIDAQABAoIBAQCGnEP6uL/i649d
++wkgWwgGo/YI3pvhIgYgeIAp0YybMeIfUMzayoNyt7QIpB5YgOFY7IUjRzpM0SEG
+atv99Ni0FgacCdjbR+JLpV0R5JOM9fYgJzjQY2x6d67+YcW3wZ98NwFj5vbi/yG1
+zcr7jsDhfw5VkSVc/XpbTq2xN4JtCSv+0ulh/NCS0U73dvgvLNHUpP+cJrbCYz/j
+XEoeGr9GxN6jkT8kCD7rcv2+5aGxaYeilhx4uo1l0gtj4CGOcUAvq/y+Ej28XUkO
+HltbLvTHkFLo+UU0VY8nUUbflouxnlqpAdxkJfUOACZdrrh7Qse2b1ztlVIMlbg0
+UAAP5jcZAoGBAOcdRIWpxLs8K24QAms7Zq2Gw4i7xBrQmNPxPCGlybR/204q6TdG
+eGzFtbOHyRBWO+50GSl26D+M+axSX+VVzbCK1wUiZltrkt4x+wqgyIuMAlVLUY+R
+XnWpnHNs7GaC5O+eYQxhsP6GkUhf7GqIB03DIxML/TfDC/4ijNzB+bD1AoGBAMDJ
+7IEVLYW6o1+2d+MBDD7oGQRZloW8hePAL60drmeOpdCBJckeCom6C6ARJDPW+pjM
+mYC6RyfGDlc3NXcik5sTMUrtfwCOcdEvgvYttOwFIuk/U+wIaD+si7EThscvC5oa
+yzNaLrbPfSim0LMsp2M8D3UMS0RIEf1BoOfJx6jDAoGAYHEiKvTRF6DgLqmXmM/M
+5RSbe+9+wgHSBH9iLFhWd2/zQAdAEsThc+J9FFHRYXPaxoLEDT2FZR+bAIHPapAH
+qWgGminktLmLLBWHQMQfa7wdLSKlAlgTJt6EXtZRP+XXSva4YMZTaaMV9TGyIjJp
+edW4STZzkFVgJ8ibJ3P6khECgYB1SmRZJElN0v8SfDD0Ku8IVqzhuJ+bPdc3ePWI
+nUY+Ossmz2vtsBk5Mbdg6wzbfS95RwEdEDe6OwT+itg8YwzqjAKxU0yxSfh1DDLh
+E22/KmDTB3RHZdYG5zMVyIt3I2grmaGG3JcPIa1DzjmqyMAN37yHubMRF8faDNOY
+MWsHgQKBgERVOwB/shfQhMN3peXezA/fcIfKUknDgGkduNAVXgstvc1LgISca7qZ
+WClUv2exSE9+8BVpliLUE2PuV07+o0mH8vlRSAAIanHC/N2uBakTHQL9FiM3h49y
+uNPjUaAOejKbpcRv+4a19nAuVDUOTGMqLvU6gm+ZCAUSwtAqHoAW
+-----END RSA PRIVATE KEY-----
diff --git a/testing/keys/alice@main_rsa.pub b/testing/keys/alice@main_rsa.pub
new file mode 100644
index 0000000..68707f5
--- /dev/null
+++ b/testing/keys/alice@main_rsa.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuDD7ikE8XPsFVt0G12Qqj1Nnd+OcS7ymf4UunlSliJAmkggYMbnAPFkBv9ms/aAv4DLe9b1QOtFigLzR8JenFnmKrP4QQWPWO2skkQapHX2gHI2T8IJxv12aIXC8j1Kl3mILYdepXwmgJfhzOLKjfj0UHnmWO6T5k4tFOf11FtTR8lTdbgYWlOY1jmMEBvZ898MUcS5DYKXOUIOZGruaF2dSoXv8gVyij0OidaeXkY7OAbNcqvZ/NVXxxhmYA7V89D84MuqfLWIRjFxwNYwl8kyxQwd48rBLscye2mDIgEsW7PHLBUKvTXjUiqfmefxRHFoxNPrrfWjrGzY+IxZKf alice-rsa@main
diff --git a/testing/keys/testinstance@adminkey_rsa b/testing/keys/testinstance@adminkey_rsa
new file mode 100644
index 0000000..4bca3a1
--- /dev/null
+++ b/testing/keys/testinstance@adminkey_rsa
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAuIyfjWjhMBAiIcG4ZvsV86EuWi921321e+F5vQdvOBzyUQr/
+R0PX/598NX4A/x6k7DRLexbA9QWu6QgE+s7LLCQ9YX2fHtenUHPRVW132Y7Nw5/s
+AdxFkIoJko2peqFq+lPQ4fc6US1QL0i5pjj0cVykw27y8KcF3oeb4MVwbPdEhu7+
+uWehUUO0SlM846QCr1J+1PJVtaGXXYCOadwHwJKFy5i+SEHDeiTc6eLiA2PlvTm1
+o6Om45fcIy/xzabsRo0hIFg+4Gt82vl3nFgh6oIvtwvNoYerwvvrf2/2enKmUr0z
+WADzhWiK/UVVkngHSce5P33dn4WkB2ZyXtfGDwIDAQABAoIBAQC1h9W2EpFXZrc8
+P0K1QYxBPq3Kll+u7n+jIJJQJ0z2hDqzDz82CX0he+6A67XtPWZ61aHdrO8W1YVM
+wc+sKdfeTrN1/0yS2QxCbfperrQyc27hW6CZ3+Mpny51UxV/g+In5GRWsYpSqWDz
+cfTzlZiVHc0QVEVyBMkYMIpbGbtR4mgDoUnFhd9LRmcrw9+OgJEkNxetb+jq2g0P
+WaftWTrn9mbANeKHXBulub2dR3xbw5Co1e7yMtkYIcQByTcRDBugkUjQ++I/2oFz
+MIVqFlMUhe8jc3kfq5jnWttkRSsPrq/I/Ang+eUSdcctUhHh+FQsltP9HEcBICHn
+p2piMhkxAoGBAOSmpLYFASBMmmn34S8Kc1smttRp3a4WwsGNl0/445Z1W0dUz39V
+H+1ivD3V3D3gFgXH2RFmD71zofdhhURmbOttvtEtw45sb96HChGRd4OZ3LiEHBvu
+AqreYfigiHdMIuLj0TomNiDhnvQizWHDibNlKGT8zP6ttfUbGcfxEWBJAoGBAM6f
+kz2FzvAcR2ZXgCiIc8Gd8rWurNsDHDq/yhTKuMSmwejfFvlk5SMk7tAkRH0/Wkt+
+3kD4IpkV0ewg9Rz1q8IThg1BTE9qR0N+OVjO5ve1ypnltwUF9i/VBgQ8bTIxX9Qt
+TJygg0IyI0Zs5EfOTXzcF6QEbBkcwjiSYSgd/iOXAoGAbVaOzwenmTVoZaIGSYNa
+1Ey4Au0492Wk7f9ySui+lBU8d+jDbKVdJhwf3gXlUqVUgqElWN+QSU0BN5Wnr6S3
+EwGgzNBwgiuydxvmIa6JEyJBXO63rldraR/8g3Lorvt2dz7vrznUina5lw8JXWWu
+9F08KsaElIimyTWTZ3wMjhkCgYAz42sMhi/jqJZdoxeyFiJLuyiaa5VJIszSDBvp
+gMdJyz7jBjM0yhuo6bt3VcRFV8WLM/8IfcfifdJL5DLp5OAPSuvdJErPnrbqwiYQ
+oVTrXCHW6BNAFbEvbeWm5q3dbvzLwdx9cOnFk+W759ikF7Dp7DObouiqnchAgLIZ
+av7JXQKBgQC/ze3gpuceQqAdCuCuxm1HDRuHLYaUluHPaRTa58R9odwrp25+kQDx
+e7m40FOUtqWqKbc31W9g1wOCL/dL0v/7BBi/I1sejXKAym2ljG4ydLIqwtw7GaLS
+h0927YxoVeamLIFOrEXzGCyFdGPKuJsC494ybsNHLUtggr5hn7biIg==
+-----END RSA PRIVATE KEY-----
diff --git a/testing/keys/testinstance@adminkey_rsa.pub b/testing/keys/testinstance@adminkey_rsa.pub
new file mode 100644
index 0000000..95705b0
--- /dev/null
+++ b/testing/keys/testinstance@adminkey_rsa.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4jJ+NaOEwECIhwbhm+xXzoS5aL3bXfbV74Xm9B284HPJRCv9HQ9f/n3w1fgD/HqTsNEt7FsD1Ba7pCAT6zsssJD1hfZ8e16dQc9FVbXfZjs3Dn+wB3EWQigmSjal6oWr6U9Dh9zpRLVAvSLmmOPRxXKTDbvLwpwXeh5vgxXBs90SG7v65Z6FRQ7RKUzzjpAKvUn7U8lW1oZddgI5p3AfAkoXLmL5IQcN6JNzp4uIDY+W9ObWjo6bjl9wjL/HNpuxGjSEgWD7ga3za+XecWCHqgi+3C82hh6vC++t/b/Z6cqZSvTNYAPOFaIr9RVWSeAdJx7k/fd2fhaQHZnJe18YP testinstance-rsa@adminkey
diff --git a/testing/keys/testinstance@other_rsa b/testing/keys/testinstance@other_rsa
new file mode 100644
index 0000000..32e9cdf
--- /dev/null
+++ b/testing/keys/testinstance@other_rsa
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEA18K3qYsgwrEcTJfeY82Ww0jSMl1v1KDhw41CI6/EwPpk160S
+AhPdxpuzTg24Anx+J/b+VdhrQhbXPJFlH3vGSygde7DVBbFHGmGb/h7cFz7Rg4O/
+xkLqUbTDX9tP0V3u2C/sEONXqTaSiiiCb7+E/aS6vf34GsiPMT9UXMWE7ZIiEZIq
+zz2T4b9GM13NR3+jbCOVbQgCiEvylG8GIuska5OTG2e/s1IgMcKvpWXpp9sCk0Oq
+6WAjaI7kgbHE9TqhwA2ADfpPS8xvBKmwGnpcp7qfdLwvPlV6NrFo6o0Atc764khz
+EYOQP1iDXKvurNsGr9YJyc/j6gYIuCBquOjCuwIDAQABAoIBAQCyjw3qPR7eoS6X
+YLQGipUzhmeWkOdE4+QTLytGV2eQgWjFaRDXMVO/0wlgFlBrllXdgzZXGyUg68Ay
++uziUk/30PodbGnPLTh358HuW+GvRyijG3yxep1rAxsRkHGNBpzswz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NB/vy0PVVPBx3onJGEjac0HIwcTG5du1+m3v8DVBhvATssOw==
+-----END RSA PRIVATE KEY-----
diff --git a/testing/keys/testinstance@other_rsa.pub b/testing/keys/testinstance@other_rsa.pub
new file mode 100644
index 0000000..33bb3f8
--- /dev/null
+++ b/testing/keys/testinstance@other_rsa.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXwrepiyDCsRxMl95jzZbDSNIyXW/UoOHDjUIjr8TA+mTXrRICE93Gm7NODbgCfH4n9v5V2GtCFtc8kWUfe8ZLKB17sNUFsUcaYZv+HtwXPtGDg7/GQupRtMNf20/RXe7YL+wQ41epNpKKKIJvv4T9pLq9/fgayI8xP1RcxYTtkiIRkirPPZPhv0YzXc1Hf6NsI5VtCAKIS/KUbwYi6yRrk5MbZ7+zUiAxwq+lZemn2wKTQ6rpYCNojuSBscT1OqHADYAN+k9LzG8EqbAaelynup90vC8+VXo2sWjqjQC1zvriSHMRg5A/WINcq+6s2wav1gnJz+PqBgi4IGq46MK7 testinstance-rsa@other