Merge lp:~sseman/juju-ci-tools/update-client-server-script into lp:juju-ci-tools

Proposed by Seman
Status: Merged
Merged at revision: 1112
Proposed branch: lp:~sseman/juju-ci-tools/update-client-server-script
Merge into: lp:juju-ci-tools
Diff against target: 229 lines (+70/-85)
3 files modified
run-client-server-test-remote.bash (+26/-14)
run-client-server-test.bash (+22/-61)
run-win-client-server-remote.bash (+22/-10)
To merge this branch: bzr merge lp:~sseman/juju-ci-tools/update-client-server-script
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+272060@code.launchpad.net

Description of the change

This branch removes the following steps from the client-server test:
  1. Copy the old and candidate Juju from S3 to local files.
  2. Copy the old and candidate Juju from local files to OS X and Windows machines.

Since we already created script that copies the old and candidate Juju directly to OS X and Windows machines before running the client-server test, there is no need to copy these files every time we run the test.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-client-server-test-remote.bash'
2--- run-client-server-test-remote.bash 2015-09-04 17:49:43 +0000
3+++ run-client-server-test-remote.bash 2015-09-23 06:44:38 +0000
4@@ -5,15 +5,22 @@
5 export JUJU_REPOSITORY=$HOME/repository
6 export SCRIPT=$HOME/juju-ci-tools
7 export PATH=$HOME/juju-ci-tools:$PATH
8-set -x
9 usage() {
10- echo "usage: $0 server client [--agent-stream stream | --agent-url url]"
11+ echo "usage: $0 candidate-version old-juju-version new-to-old [--agent-stream stream | --agent-url url]"
12 exit 1
13 }
14-test $# -ge 2 || usage
15-server="$1"
16-client="$2"
17-shift 2
18+test $# -ge 3 || usage
19+candidate_version="$1"
20+old_juju_version="$2"
21+new_to_old="$3"
22+shift 3
23+
24+set -x
25+# Extract the client and the server.
26+mkdir candidate
27+mkdir old-juju
28+tar zxf $HOME/candidate/osx/juju-$candidate_version-osx.tar.gz -C candidate
29+tar zxf $HOME/old-juju/osx/juju-$old_juju_version-osx.tar.gz -C old-juju
30
31 # Create ssh home.
32 ssh_home="/tmp/sshhome"
33@@ -22,14 +29,19 @@
34 cp $JUJU_HOME/staging-juju-rsa.pub $ssh_home/.ssh/id_rsa.pub
35 export HOME=$ssh_home
36
37-# Extract the client and the server.
38-tar zxf $server -C server
39-tar zxf $client -C client
40-server_juju=$(find server -name juju)
41-client_juju=$(find client -name juju)
42+
43+if [[ "$new_to_old" == "true" ]]; then
44+ server=$(find candidate -name juju)
45+ client=$(find old-juju -name juju)
46+else
47+ server=$(find old-juju -name juju)
48+ client=$(find candidate -name juju)
49+fi
50+echo "Server: " `$server --version`
51+echo "Client: " `$client --version`
52
53 mkdir logs
54 env=compatibility-control
55-~/Bin/juju destroy-environment --force -y $env || true
56-$SCRIPT/assess_heterogeneous_control.py $server_juju $client_juju \
57- test-reliability-aws $env logs "$@"
58+/Users/jenkins/Bin/juju destroy-environment --force -y $env || true
59+$SCRIPT/assess_heterogeneous_control.py $server $client \
60+ test-reliability-aws $env logs "$@"
61
62=== modified file 'run-client-server-test.bash'
63--- run-client-server-test.bash 2015-09-08 17:12:47 +0000
64+++ run-client-server-test.bash 2015-09-23 06:44:38 +0000
65@@ -4,85 +4,52 @@
66 export PATH=$HOME/workspace-runner:$PATH
67
68 usage() {
69- echo "usage: $0 old-version candidate-version new-to-old client-os revision-build log-dir"
70+ echo "usage: $0 old-version candidate-version new-to-old client-os log-dir"
71 exit 1
72 }
73-test $# -eq 6 || usage
74+test $# -eq 5 || usage
75 old_version="$1"
76 candidate_version="$2"
77 new_to_old="$3"
78 client_os="$4"
79-revision_build="$5"
80-log_dir="$6"
81+log_dir="$5"
82
83 set -x
84+
85+if [[ "$new_to_old" == "true" ]]; then
86+ echo "Using weekly streams for unreleased version"
87+ agent_arg="--agent-url http://juju-dist.s3.amazonaws.com/weekly/tools"
88+else
89+ echo "Using official proposed (or released) streams"
90+ agent_arg="--agent-stream proposed"
91+fi
92+
93 if [[ "$client_os" == "ubuntu" ]]; then
94- old_juju=$(find $HOME/old-juju/$old_version -name juju)
95- candidate_juju=$(find $HOME/candidate/$candidate_version -name juju)
96+ server=$(find $HOME/old-juju/$old_version -name juju)
97+ client=$(find $HOME/candidate/$candidate_version -name juju)
98+ if [[ "$new_to_old" == "true" ]]; then
99+ client=$(find $HOME/old-juju/$old_version -name juju)
100+ server=$(find $HOME/candidate/$candidate_version -name juju)
101+ fi
102+ echo "Server: " `$server --version`
103+ echo "Client: " `$client --version`
104 elif [[ "$client_os" == "osx" ]]; then
105- package=juju-$candidate_version-osx.tar.gz
106- build_dir="build-osx-client"
107- old_package=juju-$old_version-osx.tar.gz
108- archive_dir="osx"
109 user_at_host="jenkins@osx-slave.vapour.ws"
110 remote_script="run-client-server-test-remote.bash"
111 elif [[ "$client_os" == "windows" ]]; then
112- package=juju-setup-$candidate_version.exe
113- build_dir="build-win-client"
114- old_package=juju-$old_version-win.zip
115- archive_dir="win"
116+ remote_script="run-win-client-server-remote.bash"
117 user_at_host="Administrator@win-slave.vapour.ws"
118- remote_script="run-win-client-server-remote.bash"
119 else
120 echo "Unkown client OS."
121 exit 1
122 fi
123
124-# Get OS X and Windows Juju from S3.
125-if [[ "$client_os" == "osx" ]] || [[ "$client_os" == "windows" ]]; then
126- temp_dir=$(mktemp -d)
127- s3cmd --config $JUJU_HOME/juju-qa.s3cfg sync \
128- s3://juju-qa-data/juju-ci/products/version-$revision_build/$build_dir \
129- $temp_dir --exclude '*' --include $package
130- candidate_juju=$(find $temp_dir -name $package)
131- if [ "$client_os" == "windows" ]; then
132- # Extract Windows exe file and compress it.
133- innoextract -e $candidate_juju -d $temp_dir
134- zip -D $temp_dir/juju-$candidate_version-win.zip $temp_dir/app/juju.exe
135- candidate_juju=$temp_dir/juju-$candidate_version-win.zip
136- fi
137- # Get the old juju from S3.
138- old_temp_dir=$(mktemp -d)
139- s3cmd --config $JUJU_HOME/juju-qa.s3cfg sync \
140- s3://juju-qa-data/client-archive/$archive_dir $old_temp_dir --exclude '*' \
141- --include $old_package
142- old_juju=$(find $old_temp_dir -name $old_package)
143-fi
144-
145-if [[ "$new_to_old" == "true" ]]; then
146- server=$candidate_juju
147- client=$old_juju
148- echo "Using weekly streams for unreleased version"
149- agent_arg="--agent-url http://juju-dist.s3.amazonaws.com/weekly/tools"
150-else
151- server=$old_juju
152- client=$candidate_juju
153- echo "Using official proposed (or released) streams"
154- agent_arg="--agent-stream proposed"
155-fi
156-
157 run_remote_script() {
158 cat > temp-config.yaml <<EOT
159 install:
160 remote:
161 - $SCRIPTS/$remote_script
162- client:
163- - $client
164- server:
165- - $server
166-command: [remote/$remote_script,
167- "server/$(basename $server)", "client/$(basename $client)",
168- "$agent_arg"]
169+command: [remote/$remote_script, "$candidate_version", "$old_version", "$new_to_old", "$agent_arg"]
170 EOT
171 workspace-run temp-config.yaml $user_at_host
172 }
173@@ -103,10 +70,4 @@
174 rm -rf $log_dir/*
175 fi
176 done
177-
178-# Cleanup
179-if [[ "$client_os" == "osx" ]] || [[ "$client_os" == "windows" ]]; then
180- rm -rf $temp_dir
181- rm -rf $old_temp_dir
182-fi
183 exit $RESULT
184\ No newline at end of file
185
186=== modified file 'run-win-client-server-remote.bash'
187--- run-win-client-server-remote.bash 2015-09-04 17:49:43 +0000
188+++ run-win-client-server-remote.bash 2015-09-23 06:44:38 +0000
189@@ -1,16 +1,28 @@
190 # This script is intended to run on Windows. It extracts compressed Juju binary
191 # in a ZIP archive and run the client-server test.
192-set -eu
193-
194-server="$1"
195-client="$2"
196-shift 2
197-
198-/cygdrive/c/progra~2/7-Zip/7z.exe e -y -oserver $server
199-/cygdrive/c/progra~2/7-Zip/7z.exe e -y -oclient $client
200+set -eux
201+
202+candidate_version="$1"
203+old_juju_version="$2"
204+new_to_old="$3"
205+shift 3
206+
207+/cygdrive/c/progra~2/7-Zip/7z.exe e -y -oold-juju C:\\users\\Administrator\\old-juju\\win\\juju-$old_juju_version-win.zip
208+/cygdrive/c/progra~2/innoextract/innoextract.exe -e C:\\users\\Administrator\\candidate\\win\\juju-setup-$candidate_version.exe -d candidate
209+
210+if [ "$new_to_old" = "true" ]; then
211+ echo "Server:" `candidate/app/juju.exe --version`
212+ echo "Client:" `old-juju/juju.exe --version`
213+ server=candidate\\app\\juju.exe
214+ client=old-juju\\juju.exe
215+else
216+ echo "Server:" `old-juju/juju.exe --version`
217+ echo "Client:" `candidate/app/juju.exe --version`
218+ client=candidate\\app\\juju.exe
219+ server=old-juju\\juju.exe
220+fi
221
222 mkdir logs
223 juju destroy-environment --force -y compatibility-control || true
224 python C:\\users\\Administrator\\juju-ci-tools\\assess_heterogeneous_control.py \
225- server/juju.exe client/juju.exe test-win-client-server \
226- compatibility-control logs "$@"
227\ No newline at end of file
228+ $server $client test-win-client-server compatibility-control logs "$@"
229\ No newline at end of file

Subscribers

People subscribed via source and target branches