Merge lp:~ibmcharmers/charms/trusty/was-base/devel into lp:~umasv1987/charms/trusty/was-base/was-basefix

Proposed by Geetha S
Status: Needs review
Proposed branch: lp:~ibmcharmers/charms/trusty/was-base/devel
Merge into: lp:~umasv1987/charms/trusty/was-base/was-basefix
Diff against target: 1004 lines (+390/-313)
10 files modified
README.md (+57/-14)
config.yaml (+7/-5)
hooks/config-changed (+255/-213)
hooks/install (+3/-16)
hooks/start (+13/-9)
hooks/stop (+12/-7)
hooks/website-relation-changed (+1/-1)
hooks/website-relation-joined (+1/-1)
tests/10-bundles-test.py (+41/-44)
tests/local.yaml (+0/-3)
To merge this branch: bzr merge lp:~ibmcharmers/charms/trusty/was-base/devel
Reviewer Review Type Date Requested Status
vsr (community) Needs Fixing
Review via email: mp+264820@code.launchpad.net
To post a comment you must log in.
14. By Geetha S

WAS Base Committing Changes

15. By Geetha S

WAS Base Committing Changes

16. By Geetha S

WAS Base Committing Changes

Revision history for this message
vsr (vsasi) wrote :

Please update as per our - update to host file, relation-changed hook

review: Needs Fixing
17. By Geetha S

Committing WAS Base changes

18. By Geetha S

Committing WAS Base changes

19. By Geetha S

WAS Base Committing Changes

20. By Geetha S

WAS Base Committing Formmatting changes

21. By Geetha S

Committing spelling and formatting changes for WAS Base

22. By Geetha S

Committing spelling and formatting changes for WAS Base

23. By Geetha S

Committing spelling and formatting changes for WAS Base

24. By Geetha S

Committing spelling and formatting changes for WAS Base

25. By Geetha S

Committing ppc64le related changes for WAS Base

26. By Geetha S

Committing ppc64le related changes for WAS Base

27. By Geetha S

Committing ppc64le related changes for WAS Base

28. By Geetha S

Committing testcase changes for WAS Base

29. By Geetha S

Committing testcase related changes for WAS Base

30. By Geetha S

Committing code changes for WAS Base

31. By Geetha S

Committing start/stop hook changes

32. By Geetha S

Committing reverse proxy test case

Unmerged revisions

32. By Geetha S

Committing reverse proxy test case

31. By Geetha S

Committing start/stop hook changes

30. By Geetha S

Committing code changes for WAS Base

29. By Geetha S

Committing testcase related changes for WAS Base

28. By Geetha S

Committing testcase changes for WAS Base

27. By Geetha S

Committing ppc64le related changes for WAS Base

26. By Geetha S

Committing ppc64le related changes for WAS Base

25. By Geetha S

Committing ppc64le related changes for WAS Base

24. By Geetha S

Committing spelling and formatting changes for WAS Base

23. By Geetha S

Committing spelling and formatting changes for WAS Base

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2015-07-13 10:13:52 +0000
3+++ README.md 2015-08-04 08:54:53 +0000
4@@ -3,17 +3,19 @@
5 WebSphere Application Server Base
6
7 WebSphere Application Server is a proven, high-performance transaction engine that can help build, run, integrate, and manage dynamic web applications.
8-For details on IBM Websphere Application Server please visit "http://www-03.ibm.com/software/products/en/appserv-was".
9+Details on IBM Websphere Application Server and WAS Base Prduct Page available [here] [WAS-product-page].
10
11
12 # Usage
13
14-Download your licensed IBM Installation Manager software version 1.5 and above and upload to your apache repository.
15+Download your licensed IBM Installation Manager software version 1.5 and above for 'x86_64' based machine. And version 1.8 and above for 'ppc64le' based machine and upload to your apache repository.
16
17 Download your licensed IBM Websphere Base software 8.5.5.0 version and upload to your apache repository.
18
19 Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.4 and upload to your apache repository.
20
21+For 'ppc64le' based machines, Download your licensed IBM Websphere Base software WAS fixpack version 8.5.5.6 and upload to your apache repository.
22+
23 Put up all the downloaded contents on the web server like Apache and configure apache to serve these packages. These packages can be accessed using a URL from the web server.
24
25
26@@ -30,7 +32,7 @@
27 To install IBM Websphere Application Server Base you need to install IBM Installation Manager software as prerequisite.
28 To install IBM Installation Manager you need to get the packages for ubuntu, for information about the software and builds please visit (http://www-01.ibm.com/software/passportadvantage/).
29
30-To install the downloaded binaries you must agree to the IBM license. You can view the full license for IBM Installation Manager and IBM WebSphere Application Server Base by visiting the [Software license agreements search website](http://www-03.ibm.com/software/sla/sladb.nsf/search). Search for "IBM Installation Manager" and "IBM Websphere Application Server" and choose the license that applies to the version you are using.
31+To install the downloaded binaries you must agree to the IBM license. You can view the full license for IBM Installation Manager and IBM WebSphere Application Server Base by visiting the [Software license agreements search website][License] Search for "IBM Installation Manager" and "IBM Websphere Application Server" and choose the license that applies to the version you are using.
32
33
34 Run the following to deploy this charm:
35@@ -83,7 +85,7 @@
36
37
38 `im_file_name`
39-The IBM Installation Manager Package name. If not set, It is assigned the value "Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip" for x86_64 based machine.
40+The IBM Installation Manager Package name. If not set, It will assign the value "Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip" for x86_64 based machine and "agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip" for ppc64le based machine.
41
42 `sha_im`
43 Checksum value to check integrity of IBM Installation Manager package. The Charm uses sha1sum to check the integrity. If empty, it does not carry out the integrity check. Use `sha1sum <Package Location/Package Name> | cut -d" " -f1` to find out Checksum value for downloaded package. Cryptographic value should be altered by the user only when the package name is change. Else it should not be altered.
44@@ -91,19 +93,60 @@
45 #IBM WAS Base Information
46
47 (1) General Information
48-Information on IBM WAS available at the [WAS Infocenter] (http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/as_ditamaps/was855_welcome_ndmp.html?lang=en).
49+Information on IBM WAS available [here] [WAS-Infocenter]
50
51 (2) Download Information
52-Information on procuring WAS product is available at the [Passport Advantage Site](http://www-01.ibm.com/software/passportadvantage/).
53-
54-Refer this URL for WAS 8.5.5.0 download (http://www-01.ibm.com/support/docview.wss?uid=swg27038625).
55-
56-Refer this URL for WAS 8.5.5.4 fixpack download (http://www-01.ibm.com/support/docview.wss?uid=swg24038539).
57-
58-A trial version is available [here] ( http://www.ibm.com/developerworks/downloads/ws/was/index.html).
59-
60-Refer this URL for more information about Downloadable files (http://www-01.ibm.com/support/docview.wss?uid=swg24038380).
61+
62+Downloadable Package Names for 'x86_64' based machine:
63+WAS_V8.5.5_1_OF_3.zip
64+WAS_V8.5.5_2_OF_3.zip
65+WAS_V8.5.5_3_OF_3.zip
66+8.5.5-WS-WAS-FP0000004-part1.zip
67+8.5.5-WS-WAS-FP0000004-part2.zip
68+
69+Downloadable Package Names for 'ppc64le' based machine:
70+WAS_V8.5.5_FOR_POWERLE_ML.zip
71+WAS_V8.5.5_2_OF_2_FOR_POWERLE_ML.zip
72+8.5.5-WS-WAS-LE-FP0000006-part1.zip
73+8.5.5-WS-WAS-LE-FP0000006-part2.zip
74+
75+Information on procuring WAS product is available at the [Passport Advantage site] [Passport-Advantage]
76+
77+Details about WAS 8.5.5.0 download available [here] [[WAS-8.5.5.0-download]
78+
79+Information about insatllation of WAS Base on 'ppc64le' based machine available [here] [WAS-for-ppc64le]
80+
81+Details about WAS 8.5.5.4 fixpack download available [here] [WAS-8.5.5.4-fixpack-download].
82+
83+A trial version is available [here] [WAS-trail-version].
84+
85+More information about IBM IM Downloadable file available [here] [IBM-IM-more-info]
86
87 (3) Contact Information
88
89 For issues with this charm, please contact jujusupp@us.ibm.com
90+
91+<!-- Links -->
92+
93+[WAS-Infocenter]: http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/as_ditamaps/was855_welcome_ndmp.html?lang=en
94+
95+[WAS-product-page]: http://www-03.ibm.com/software/products/en/appserv-was
96+
97+[WAS-8.5.5.0-download]: http://www-01.ibm.com/support/docview.wss?uid=swg27038625
98+
99+[WAS-8.5.5.4-fixpack-download]: http://www-01.ibm.com/support/docview.wss?uid=swg24038539
100+
101+[WAS-trail-version]: http://www.ibm.com/developerworks/downloads/ws/was/index.html
102+
103+[Passport-Advantage]: http://www-01.ibm.com/software/passportadvantage/
104+
105+[IBM-IM-more-info]: http://www-01.ibm.com/support/docview.wss?uid=swg24038380
106+
107+[WAS-for-ppc64le]: http://www-304.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.installation.nd.doc/ae/cins_offerings.html?lang=en-us
108+
109+[WAS-pp64le-infocenter]: http://www-304.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.installation.nd.doc/ae/tins_installation_dist_cl.html?lang=en
110+
111+[WAS-ppc64le-fixpack-info]: http://www-01.ibm.com/support/docview.wss?uid=swg24040035
112+
113+[License]: http://www-03.ibm.com/software/sla/sladb.nsf/search
114+
115
116=== modified file 'config.yaml'
117--- config.yaml 2015-07-13 10:13:52 +0000
118+++ config.yaml 2015-08-04 08:54:53 +0000
119@@ -4,14 +4,14 @@
120 default: ""
121 description: |
122 Download url for WAS Base packages, This is the URL containing WAS Base packages,
123- mention till the folder which contains packages ex: http://9.124.100.99/debs/WAS-BASE/.
124+ mention till the folder which contains packages ex: http://<ip-address>/debs/WAS-BASE/.
125 im_install_path:
126 type: string
127 default: "/opt/IBM/InstallationManager"
128 description: |
129 Install Location for Installation Manager.Please enter the path
130 where you wants to install Install Manager ex : /opt/IBM/InstallationManager
131- here IM will install at this location, It Can be changed if IM needs to be installed at some other place.
132+ here IM will install at this location, It can be changed if IM needs to be installed at some other place.
133 im_file_name:
134 type: string
135 default: ""
136@@ -26,19 +26,21 @@
137 description: |
138 The IBM WebSphere Application Server software comes with special terms and
139 conditions from IBM. The WebSphere software can only be used by
140- accepting the license terms and conditions.
141+ accepting the license terms and conditions. It should be set to "True" to install
142+ the Websphere Application Server software.
143 accept-ibm-im-license:
144 type: boolean
145 default: False
146 description: |
147 The IBM Installation Manager software comes with special terms and
148 conditions from IBM. The Installation Manager software can only be used by
149- accepting the license terms and conditions.
150+ accepting the license terms and conditions. It should be set to "True" to install
151+ the IBM Installation Manager software.
152 sha_im:
153 type: string
154 default: ""
155 description: |
156- Checksum value to check integrity of IBM IM pacakage. The Charm uses
157+ Checksum value to check integrity of IBM IM package. The Charm uses
158 sha1sum to check the integrity. For example, run the command:
159 <sha1sum Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip | cut -d " " -f1>
160 to get the checksum value for IBM Installation Manager pacakage.
161
162=== modified file 'hooks/config-changed'
163--- hooks/config-changed 2015-07-13 10:13:52 +0000
164+++ hooks/config-changed 2015-08-04 08:54:53 +0000
165@@ -9,9 +9,9 @@
166 is_im_installed()
167 {
168 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then
169- echo "True"
170+ echo "True"
171 else
172- echo "False"
173+ echo "False"
174 fi
175
176 }
177@@ -21,9 +21,9 @@
178 is_was_base_installed()
179 {
180 if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then
181- echo "True"
182+ echo "True"
183 else
184- echo "False"
185+ echo "False"
186 fi
187
188 }
189@@ -35,26 +35,29 @@
190
191 was_base_installed=`is_was_base_installed`
192 if [ $was_base_installed == True ]; then
193- juju-log "IBM WAS Base: Removing WAS BASE Installation"
194- juju-log "IBM WAS Base: Server stopping"
195- $WAS_BASE_INSTALL_PATH/profiles/test/bin/stopServer.sh server1
196- if [ "$?" -ne "0" ]; then
197- juju-log "IBM WAS Base: Error while stoping the server"
198- else
199- juju-log "IBM WAS Base: Server stopped successfully"
200- fi
201+ juju-log "IBM WAS Base: Removing WAS BASE Installation"
202+ juju-log "IBM WAS Base: Server stopping"
203+ $WAS_BASE_INSTALL_PATH/profiles/test/bin/stopServer.sh server1
204+ if [ "$?" -ne "0" ]; then
205+ juju-log "IBM WAS Base: Error while stopping the server"
206+ else
207+ juju-log "IBM WAS Base: Server stopped successfully"
208+ fi
209
210 # Uninstalling WAS BASE
211- $IM_INSTALL_PATH/eclipse/tools/imcl uninstall com.ibm.websphere.BASE.v85 -installationDirectory $WAS_BASE_INSTALL_PATH
212- if [ -d /root/IBM/WebSphere/AppServer/V85/BASE ]; then
213- juju-log "IBM WAS Base: Removing install dir"
214- cd /root
215- rm -rf IBM/WebSphere/AppServer/V85/BASE
216+ $IM_INSTALL_PATH/eclipse/tools/imcl uninstall com.ibm.websphere.BASE.v85 -installationDirectory $WAS_BASE_INSTALL_PATH
217+ if [ -d /root/IBM/WebSphere/AppServer/V85/BASE ]; then
218+ juju-log "IBM WAS Base: Removing installation directory"
219+ cd /root
220+ rm -rf IBM/WebSphere/AppServer/V85/BASE
221+ else
222+ juju-log "IBM WAS Base: Installation directory does not exist"
223+ fi
224+ juju-log "IBM WAS Base: Uninstalling WAS Base software completed"
225+
226 else
227- juju-log "IBM WAS Base: Install directory is not exist"
228- fi
229- fi
230- juju-log "IBM WAS Base: Uninstalling WAS BASE software completed"
231+ juju-log "IBM WAS Base: WAS Base software has not been installed."
232+ fi
233 }
234
235 #Remove IM, if installed
236@@ -62,9 +65,9 @@
237 {
238 im_installed=`is_im_installed`
239 if [ $im_installed == True ]; then
240- juju-log "IBM WAS Base: Removing IBM IM software."
241- /root/var/ibm/InstallationManager/uninstall/uninstallc
242- juju-log "IBM WAS Base: Removed IBM IM software"
243+ juju-log "IBM WAS Base: Removing IBM IM software."
244+ /root/var/ibm/InstallationManager/uninstall/uninstallc
245+ juju-log "IBM WAS Base: Removed IBM IM software"
246 fi
247
248 }
249@@ -74,27 +77,27 @@
250 {
251
252 if [ $1 == False ]; then
253- juju-log "IBM WAS Base: Removing IBM WebSphere (if installed) as the license agreement is not accepted."
254- if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then
255- juju-log "IBM WAS Base: IBM IM exists "
256- remove_was_base_software
257- else
258- juju-log "IBM WAS Base: IBM IM not exists and hence exiting from WAS unistalling"
259- exit 0
260- fi
261+ juju-log "IBM WAS Base: Removing IBM WebSphere (if installed) as the license agreement is not accepted."
262+ if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then
263+ juju-log "IBM WAS Base: IBM IM exists "
264+ remove_was_base_software
265+ else
266+ juju-log "IBM WAS Base: IBM IM does not exist and hence exiting from WAS uninstalling"
267+ exit 0
268+ fi
269 fi
270 if [ $2 == False ]; then
271- juju-log "IBM WAS Base: Removing IBM IM (if installed) as the license agreement is not accepted."
272-
273- #Check any dependent products exists like WAS
274-
275- if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then
276- juju-log "IBM WAS Base: Can not uninstall IM as its has WAS product installed"
277- exit 0
278- else
279- juju-log "IBM WAS Base: Uninstall IBM IM software"
280- remove_im_software
281- fi
282+ juju-log "IBM WAS Base: Removing IBM IM (if installed) as the license agreement is not accepted."
283+
284+ #Check any dependent products exists like WAS
285+
286+ if [ -d $WAS_BASE_INSTALL_PATH/bin ]; then
287+ juju-log "IBM WAS Base: Can not uninstall IM as it has WAS product installed"
288+ exit 0
289+ else
290+ juju-log "IBM WAS Base: Uninstall IBM IM software"
291+ remove_im_software
292+ fi
293 fi
294
295 }
296@@ -109,7 +112,7 @@
297 fi
298
299 # If an install IM done, get the name of the package from which it was done
300- if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then
301+ if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then
302 im_pkg_name=`ls $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip`
303 if [ $? == 0 ]; then
304 im_pkg_name=`basename $im_pkg_name`
305@@ -120,42 +123,38 @@
306 cfg_im_pkg_name=$im_file_name
307
308 # Set package name to a predefined value if the user has not provided a package name
309- if [ "$cfg_im_pkg_name" == "" ]; then
310- ARCHITECTURE=`uname -m`
311- if [ "$ARCHITECTURE" = "x86_64" ] || [ "$ARCHITECTURE" = "ppc64le" ]; then
312- cfg_im_pkg_name="Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip"
313+ if [ "$cfg_im_pkg_name" == "" ]; then
314+ if [ "$ARCHITECTURE" = "x86_64" ]; then
315+ cfg_im_pkg_name="Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip"
316+ elif [ "$ARCHITECTURE" = "ppc64le" ]; then
317+ cfg_im_pkg_name="agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip"
318 else
319 juju-log "IBM WAS Base: Platform not supported for IM."
320 exit 1
321 fi
322- fi
323+ fi
324
325 # The user has configured a different package name
326 if [ "$im_pkg_name" != "$cfg_im_pkg_name" ]; then
327-
328- #Download the new IM package
329 set +e
330+ #previously downloaded and installed IM software
331+ if [ "$im_pkg_name" != "" ]; then
332+ juju-log "IBM WAS Base: Deleting the older IM package."
333+ rm -rf $CHARM_DIR/$ARCHIVE_DIR/IM
334+ remove_was_base_software
335+ remove_im_software
336+ fi
337+ #Download the new IM package
338 juju-log "IBM WAS Base: Downloading IM package."
339-
340 wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR/IM $WAS_URL/$cfg_im_pkg_name
341-
342 if [ $? == 0 ]; then
343 juju-log "IBM WAS Base: Downloaded IM package."
344- # Delete previously downloaded and installed IM software
345- if [ "$im_pkg_name" != "" ]; then
346- juju-log "IBM WAS Base: Deleting the older IM package."
347- rm $CHARM_DIR/$ARCHIVE_DIR/IM/$im_pkg_name
348- remove_was_base_software
349- remove_im_software
350- fi
351-
352 else
353 juju-log "IBM WAS Base: Download of IM package failed."
354 juju-log "IBM WAS Base: Ensure the download URL and package name are correctly set in the charm configuration."
355 exit 0
356 fi
357 set -e
358-
359 fi
360
361 # Check integrity of downloaded package
362@@ -176,208 +175,251 @@
363 if [ "$WAS_URL" == "" ]; then
364 juju-log "IBM WAS Base: URL to download IBM WAS Base package is not configured."
365 exit 0
366- else
367+ else
368 juju-log "Downloading WAS Base Packages"
369 was_base_pkg1="WAS_V8.5.5_1_OF_3.zip"
370 was_base_pkg2="WAS_V8.5.5_2_OF_3.zip"
371 was_base_pkg3="WAS_V8.5.5_3_OF_3.zip"
372 was_base_fixpack1="8.5.5-WS-WAS-FP0000004-part1.zip"
373 was_base_fixpack2="8.5.5-WS-WAS-FP0000004-part2.zip"
374- if [ -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 ];then
375- juju-log " IBM WAS Base:Reinstalling WAS Base, Downloaded Packages already exists in Archive Dir. "
376- else
377- wget $WAS_URL/$was_base_pkg1 $WAS_URL/$was_base_pkg2 $WAS_URL/$was_base_pkg3 $WAS_URL/$was_base_fixpack1 $WAS_URL/$was_base_fixpack2
378- if [ $? == 0 ]; then
379- juju-log "IBM WAS Base: Downloaded WAS Base packages sucessfully"
380- fi
381- fi
382+ was_base_ppc64le_pkg1="WAS_V8.5.5_FOR_POWERLE_ML.zip"
383+ was_base_ppc64le_pkg2="WAS_V8.5.5_2_OF_2_FOR_POWERLE_ML.zip"
384+ was_base_ppc64le_fixpack1="8.5.5-WS-WAS-LE-FP0000006-part1.zip"
385+ was_base_ppc64le_fixpack2="8.5.5-WS-WAS-LE-FP0000006-part2.zip"
386+
387+ if [ "$ARCHITECTURE" == "x86_64" ];then
388+ if [ -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 ];then
389+ juju-log " IBM WAS Base:Installing WAS Base, Downloaded packages already exists in archive directory."
390+ else
391+ wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR $WAS_URL/$was_base_pkg1 $WAS_URL/$was_base_pkg2 $WAS_URL/$was_base_pkg3 $WAS_URL/$was_base_fixpack1 $WAS_URL/$was_base_fixpack2
392+ if [ $? == 0 ]; then
393+ juju-log "IBM WAS Base: Downloaded WAS Base packages successfully"
394+ fi
395+ fi
396+ elif [ "$ARCHITECTURE" == "ppc64le" ];then
397+ if [ -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg2 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack1 -a -f $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack2 ];then
398+ juju-log " IBM WAS Base:Installing WAS Base, Downloaded packages already exists in archive directory."
399+ else
400+ wget -t 2 -P $CHARM_DIR/$ARCHIVE_DIR $WAS_URL/$was_base_ppc64le_pkg1 $WAS_URL/$was_base_ppc64le_pkg2 $WAS_URL/$was_base_ppc64le_fixpack1 $WAS_URL/$was_base_ppc64le_fixpack2
401+ if [ $? == 0 ]; then
402+ juju-log "IBM WAS Base: Downloaded WAS Base packages successfully"
403+ fi
404+ fi
405+
406+ fi
407 fi
408
409- # Check integrity of downloaded package
410- if [ "b9cc0b783b482de2092d5c387de05cda2e922413" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/WAS_V8.5.5_1_OF_3.zip | cut -d" " -f1`" ]; then
411- juju-log "IBM WAS Base: IBM WAS package1 is corrupt."
412- exit 0
413- fi
414- if [ "74a52b1b5aaedd67c0727db90aff9dc63ff28f4e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/WAS_V8.5.5_2_OF_3.zip | cut -d" " -f1`" ]; then
415- juju-log "IBM WAS Base: IBM WAS package2 is corrupt."
416- exit 0
417- fi
418- if [ "e6943fa4a4a7a1384fad1faa54289106f0e57979" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/WAS_V8.5.5_3_OF_3.zip | cut -d" " -f1`" ]; then
419- juju-log "IBM WAS Base: IBM WAS package3 is corrupt."
420- exit 0
421- fi
422- if [ "895863b932334a78cccce6c73ec98d35ba98639b" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS-FP0000004-part1.zip | cut -d" " -f1`" ]; then
423- juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt."
424- exit 0
425- fi
426- if [ "8f8560746c6fb0f87cd47801a014e7c34fccc4cc" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS-FP0000004-part2.zip | cut -d" " -f1`" ]; then
427- juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt."
428- exit 0
429- fi
430+ # Check integrity of downloaded package
431+ if [ "$ARCHITECTURE" == "x86_64" ];then
432+ if [ "b9cc0b783b482de2092d5c387de05cda2e922413" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg1 | cut -d" " -f1`" ]; then
433+ juju-log "IBM WAS Base: IBM WAS package1 is corrupt."
434+ exit 0
435+ fi
436+ if [ "74a52b1b5aaedd67c0727db90aff9dc63ff28f4e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg2 | cut -d" " -f1`" ]; then
437+ juju-log "IBM WAS Base: IBM WAS package2 is corrupt."
438+ exit 0
439+ fi
440+ if [ "e6943fa4a4a7a1384fad1faa54289106f0e57979" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_pkg3 | cut -d" " -f1`" ]; then
441+ juju-log "IBM WAS Base: IBM WAS package3 is corrupt."
442+ exit 0
443+ fi
444+ if [ "895863b932334a78cccce6c73ec98d35ba98639b" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack1 | cut -d" " -f1`" ]; then
445+ juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt."
446+ exit 0
447+ fi
448+ if [ "8f8560746c6fb0f87cd47801a014e7c34fccc4cc" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_fixpack2 | cut -d" " -f1`" ]; then
449+ juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt."
450+ exit 0
451+ fi
452+ elif [ "$ARCHITECTURE" == "ppc64le" ];then
453+ if [ "62cc5a2d23a2ff828d2b4dcd9ac754b3ff994292" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg1 | cut -d" " -f1`" ]; then
454+ juju-log "IBM WAS Base: IBM WAS package1 is corrupt."
455+ exit 0
456+ fi
457+ if [ "bc475ccd6f918bf858ccbb48d82e5adc2c7b3fa9" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_pkg2 | cut -d" " -f1`" ]; then
458+ juju-log "IBM WAS Base: IBM WAS package2 is corrupt."
459+ exit 0
460+ fi
461+ if [ "c0f38a16b87b7e6e7c5c0f609fb3c1a61a3b7e8e" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack1 | cut -d" " -f1`" ]; then
462+ juju-log "IBM WAS Base: IBM WAS Fix Pack part1 is corrupt."
463+ exit 0
464+ fi
465+ if [ "c8fe75b915fa2ecd183af208eff7df0464342ff8" != "`sha1sum $CHARM_DIR/$ARCHIVE_DIR/$was_base_ppc64le_fixpack2 | cut -d" " -f1`" ]; then
466+ juju-log "IBM WAS Base: IBM WAS Fix Pack part2 is corrupt."
467+ exit 0
468+ fi
469+ fi
470+
471 }
472
473
474-
475-
476-
477 juju-log "IBM WAS BASE: Begin config-change hook"
478 was_base_license_accepted=`config-get accept-ibm-websphere-license`
479 im_license_accepted=`config-get accept-ibm-im-license`
480 IM_INSTALL_PATH=`config-get im_install_path`
481 WAS_URL=`config-get was_url`
482 im_file_name=`config-get im_file_name`
483+ARCHITECTURE=`uname -m`
484
485 # Remove IM and WAS if license not accepted abase exit. Else install it
486 remove_unaccepted_software $was_base_license_accepted $im_license_accepted
487 if [ $im_license_accepted == False ]; then
488- juju-log "IBM WAS Base: Websphere IM License not accepted."
489+ juju-log "IBM WAS Base: Websphere IM License not accepted."
490
491 elif [ $im_license_accepted == True ]; then
492- juju-log "IBM WAS Base: IBM IM License accepted"
493- juju-log "IBM WAS Base: downloading and extracting IM packages"
494- cd $CHARM_DIR/$ARCHIVE_DIR
495- if [ -d $CHARM_DIR/$ARCHIVE_DIR/IM ];then
496- juju-log "IBM WAS Base: Removing Existing IM DIR. Cresting new IM DIR"
497- rm -rf $CHARM_DIR/$ARCHIVE_DIR/IM
498- fi
499- mkdir IM
500- cd IM
501- download_IM
502+ juju-log "IBM WAS Base: IBM IM License accepted"
503+ download_IM
504+ im_inst=`is_im_installed`
505+ if [ $im_inst == False ]; then
506 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip ]; then
507- unzip $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip -d $CHARM_DIR/$ARCHIVE_DIR/IM
508- if [ $? != 0 ]; then
509- juju-log "IBM WAS Base: Unable to extract the IM package content. Verify whether the package is corrupt."
510- # Remove corrupt archive file
511- rm -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip
512- exit 0
513- fi
514- fi
515-
516- im_inst=`is_im_installed`
517- if [ $im_inst == False ]; then
518+ juju-log "IBM WAS Base: downloading and extracting IM packages"
519+ if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ]; then
520+ juju-log "IBM WAS Base: IBM IM package contents extracted already."
521+ else
522+ unzip $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip -d $CHARM_DIR/$ARCHIVE_DIR/IM
523+ if [ $? != 0 ]; then
524+ juju-log "IBM WAS Base: Unable to extract the IM package content. Verify whether the package is corrupt."
525+ # Remove corrupt archive file
526+ rm -f $CHARM_DIR/$ARCHIVE_DIR/IM/*.zip
527+ exit 0
528+ fi
529+ fi
530+ fi
531 juju-log "IBM WAS Base: IM installation start"
532- # Check IM package availability
533+ # Check IM package availability
534 juju-log $CHARM_DIR/$ARCHIVE_DIR
535 if [ -f $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc ];
536 then
537- juju-log "IBM WAS Base: IM Packages available for installation."
538- cp $CHARM_DIR/$ARCHIVE_DIR/IM/install.xml $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml
539- sed -i "2 a \<profile kind='self' installLocation='$IM_INSTALL_PATH' id='IBM Installation Manager'>\n <data key='eclipseLocation' value='$IM_INSTALL_PATH' />\n</profile>" $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml
540- $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml -acceptlicense
541-
542-
543+
544+ juju-log "IBM WAS Base: IM Packages available for installation."
545+ cp $CHARM_DIR/$ARCHIVE_DIR/IM/install.xml $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml
546+ sed -i "2 a \<profile kind='self' installLocation='$IM_INSTALL_PATH' id='IBM Installation Manager'>\n <data key='eclipseLocation' value='$IM_INSTALL_PATH' />\n</profile>" $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml
547+ $CHARM_DIR/$ARCHIVE_DIR/IM/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/IM/silent_install.xml -acceptlicense
548 if [ $? == 0 ]
549 then
550- juju-log "IBM WAS Base: IM Is installed successfully"
551+ juju-log "IBM WAS Base: IM Is installed successfully"
552 else
553- juju-log "IBM WAS Base: Error while installing IM"
554+ juju-log "IBM WAS Base: Error while installing IM"
555+ exit 1
556+ fi
557+
558+ else
559+ juju-log "IBM WAS Base: IM Packages missing. Please check README file"
560+ juju-log "IBM WAS Base: Upgrade IM charm after adding the IM packages";
561 exit 1
562- fi
563-
564- else
565- juju-log "IBM WAS Base: IM Packages missing. Please check README file"
566- juju-log "IBM WAS Base: Upgrade IM charm after adding the IM packages";
567- exit 1
568- fi
569- fi
570+ fi
571+ else
572+ juju-log "IBM WAS Base: IBM IM Installed already using same package name."
573+ fi
574 else
575- juju-log " IBM WAS Base: Acceptable values for license is 'True' or 'False'"
576+ juju-log " IBM WAS Base: Acceptable values for license is 'True' or 'False'"
577
578 fi
579
580 if [ $was_base_license_accepted == False ]; then
581- juju-log "IBM WAS Base: Websphere BASE License not accepted."
582-
583+ juju-log "IBM WAS Base: Websphere BASE License not accepted."
584 elif [ $was_base_license_accepted == True ]; then
585- juju-log "IBM WAS Base: Check WAS Base package availability"
586- cd $CHARM_DIR/$ARCHIVE_DIR
587+ juju-log "IBM WAS Base: Check WAS Base package availability"
588+ is_was_base_installed=`is_was_base_installed`
589+ if [ $is_was_base_installed == False ];then
590 download_WAS
591 if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ];then
592- juju-log "IBM WAS Base: Reinstalling WAS BASE, unzipped package contents aavailable"
593- else
594- unzip 'WAS_*.zip'
595- if [ $? != 0 ]; then
596- juju-log "IBM WAS Base: Unable to extract the WAS packages content. Verify whether the package is corrupt."
597- # Remove corrupt archive file
598- rm -f $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip'
599- exit 0
600- else
601- juju-log "IBM WAS Base: Downloaded and Extracted WAS Base Packages Sucessfully"
602- fi
603+ juju-log "IBM WAS Base: Installing WAS Base, unzipped package contents aavailable"
604+ else
605+ unzip $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/
606+ if [ $? != 0 ]; then
607+ juju-log "IBM WAS Base: Unable to extract the WAS packages content. Verify whether the package is corrupt."
608+ # Remove corrupt archive file
609+ rm -f $CHARM_DIR/$ARCHIVE_DIR/'WAS_*.zip'
610+ exit 0
611+ else
612+ juju-log "IBM WAS Base: Downloaded and Extracted WAS Base Packages Sucessfully"
613+ fi
614 fi
615 if [ -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack ];then
616- juju-log "IBM WAS Base: WAS Base Fixpack packages are available for upgrading"
617+ juju-log "IBM WAS Base: WAS Base Fixpack packages are available for upgrading"
618 else
619- mkdir was_fixpack
620- unzip '8.5.5-WS-WAS*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack
621+ unzip $CHARM_DIR/$ARCHIVE_DIR/'8.5.5-WS-WAS*.zip' -d $CHARM_DIR/$ARCHIVE_DIR/was_fixpack/
622 if [ $? != 0 ]; then
623- juju-log "IBM WAS Base: Unable to extract the WAS Base fixpack packages content. Verify whether the package is corrupt."
624- # Remove corrupt archive file
625- rm -f $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS*.zip
626- exit 0
627+ juju-log "IBM WAS Base: Unable to extract the WAS Base fixpack packages content. Verify whether the package is corrupt."
628+ # Remove corrupt archive file
629+ rm -f $CHARM_DIR/$ARCHIVE_DIR/8.5.5-WS-WAS*.zip
630+ exit 0
631 else
632- juju-log "IBM WAS Base: Downloaded and Extracted WAS Base fixpack Packages Sucessfully"
633- fi fi
634-
635-
636- # check WAS package availability
637- if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ]; then
638- juju-log "IBM WAS Base: WAS BASE Packages available for installation.";
639- #Check IM installation
640+ juju-log "IBM WAS Base: Downloaded and Extracted WAS Base fixpack Packages Sucessfully"
641+ fi
642+ fi
643+ # check WAS package availability
644+ if [ -d "$CHARM_DIR/$ARCHIVE_DIR/disk1" ]; then
645+ juju-log "IBM WAS Base: WAS BASE Packages available for installation.";
646+ #Check IM installation
647 im_installed=`is_im_installed`
648- if [ $im_installed == True ]; then
649-
650- juju-log "IBM WAS Base: Installing WAS BASE "
651- $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85 -acceptLicense -repositories $CHARM_DIR/$ARCHIVE_DIR/ -installationDirectory $WAS_BASE_INSTALL_PATH -showProgress
652+ if [ $im_installed == True ]; then
653+ juju-log "IBM WAS Base: Installing WAS BASE "
654+ if [ "$ARCHITECTURE" == "x86_64" ];then
655+ $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85 -acceptLicense -repositories $CHARM_DIR/$ARCHIVE_DIR/ -installationDirectory $WAS_BASE_INSTALL_PATH -showProgress
656+ if [ $? == 0 ];
657+ then
658+ juju-log " IBM WAS Base: WAS Base is installed successfully"
659+ else
660+ juju-log "IBM WAS Base: Error while installing WAS"
661+ exit 1
662+ fi
663+ elif [ "$ARCHITECTURE" == "ppc64le" ];then
664+ $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.le.v85 -acceptLicense -repositories $CHARM_DIR/$ARCHIVE_DIR/ -installationDirectory $WAS_BASE_INSTALL_PATH -showProgress
665+ if [ $? == 0 ];
666+ then
667+ juju-log " IBM WAS Base: WAS Base is installed successfully"
668+ else
669+ juju-log "IBM WAS Base: Error while installing WAS"
670+ exit 1
671+ fi
672+
673+ fi
674+ else
675+ juju-log "IBM WAS Base: IM needs to be installed before installing WAS."
676+ exit 0
677+ fi
678+ juju-log "IBM WAS Base: creating a profile"
679+ #sh does not work in ubuntu so linking to bash
680+ juju-log "IBM WAS Base: Unlink /bin/sh"
681+ unlink /bin/sh
682+ ln -s /bin/bash /bin/sh
683+ juju-log "IBM WAS Base: creating a profile"
684+ $WAS_BASE_INSTALL_PATH/bin/manageprofiles.sh -create -profileName "test" -profilePath "$WAS_BASE_INSTALL_PATH/profiles/test" -templatePath "$WAS_BASE_INSTALL_PATH/profileTemplates/default" -nodeName "node1" -cellName "cell1" -serverName "server1" -adminUserName "wasadmin" -adminPassword "wasadmin"
685+ juju-log "IBM WAS Base: Profile creation completed"
686+ #Apply fixpack 8.5.5.4 to upgrade was base version from 8.5.5.0 to 8.5.5.4
687+ juju-log "IBM WAS Base: Upgrading WAS Base by installing WAS fixpack"
688+ if [ "$ARCHITECTURE" == "x86_64" ];then
689+ $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85_8.5.5004.20141119_1746 -repositories $CHARM_DIR/files/archives/was_fixpack -installationDirectory $WAS_BASE_INSTALL_PATH -acceptLicense -showProgress
690+ elif [ "$ARCHITECTURE" == "ppc64le" ];then
691+ $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.le.v85_8.5.5006.20150529_0614 -repositories $CHARM_DIR/files/archives/was_fixpack -installationDirectory $WAS_BASE_INSTALL_PATH -acceptLicense -showProgress
692+ fi
693 if [ $? == 0 ];
694 then
695- juju-log " IBM WAS Base: WAS Base is installed successfully"
696- else
697- juju-log "IBM WAS Base: Error while installing WAS"
698- exit 1
699- fi
700- else
701- juju-log "IBM WAS Base: IM is not installaed to install WAS"
702- exit 0
703- fi
704-
705- juju-log "IBM WAS Base: creating a profile"
706- #sh does not work in ubuntu so linking to bash
707-
708- juju-log "IBM WAS Base: Unlink /bin/sh"
709- unlink /bin/sh
710- ln -s /bin/bash /bin/sh
711- juju-log "IBM WAS Base: creating a profile"
712-
713- $WAS_BASE_INSTALL_PATH/bin/manageprofiles.sh -create -profileName "test" -profilePath "$WAS_BASE_INSTALL_PATH/profiles/test" -templatePath "$WAS_BASE_INSTALL_PATH/profileTemplates/default" -nodeName "node1" -cellName "cell1" -serverName "server1" -adminUserName "wasadmin" -adminPassword "wasadmin"
714- juju-log "IBM WAS Base: Profile creation completed"
715-
716- #Apply fixpack 8.5.5.4 to upgrade was base version from 8.5.5.0 to 8.5.5.4
717-
718- juju-log "IBM WAS Base: Upgrading WAS Base by installing WAS fixpack"
719- $IM_INSTALL_PATH/eclipse/tools/imcl install com.ibm.websphere.BASE.v85_8.5.5004.20141119_1746 -repositories $CHARM_DIR/files/archives/was_fixpack -installationDirectory $WAS_BASE_INSTALL_PATH -acceptLicense -showProgress
720- if [ $? == 0 ];
721- then
722- juju-log " IBM WAS Base: WAS fixpack installed successfully"
723+ juju-log " IBM WAS Base: WAS fixpack installed successfully"
724+ else
725+ juju-log "IBM WAS Base: Error while installing WAS fixpack"
726+ exit 1
727+ fi
728+ #starting the server
729+ cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
730+ juju-log "IBM WAS Base: Server Starting"
731+ ./startServer.sh server1
732+ if [ "$?" -ne "0" ]; then
733+ juju-log "IBM WAS Base: Error while starting the server"
734+ else
735+ juju-log "IBM WAS Base: Server started successfully"
736+ fi
737+
738+
739 else
740- juju-log "IBM WAS Base: Error while installing WAS fixpack"
741- exit 1
742+ juju-log "IBM WAS Base: WAS BASE Packages are not available"
743 fi
744- else
745- juju-log "IBM WAS Base: WAS BASE Packages are not available"
746+ else
747+ juju-log "IBM WAS Base: IBM WAS Base Software installed already"
748 fi
749 else
750 juju-log "IBM WAS Base: Acceptable values for license is 'True' or 'False'"
751 fi
752-
753-#starting the server
754- cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
755- juju-log "IBM WAS Base: Server Starting"
756- ./startServer.sh server1
757- if [ "$?" -ne "0" ]; then
758- juju-log "IBM WAS Base: Error while starting the server"
759- else
760- juju-log "IBM WAS Base: Server started successfully"
761-
762- fi
763-
764+juju-log "IBM WAS Base: End Config-Changed hook..."
765
766=== modified file 'hooks/install'
767--- hooks/install 2015-07-13 10:13:52 +0000
768+++ hooks/install 2015-08-04 08:54:53 +0000
769@@ -9,28 +9,15 @@
770 apt-get install -y wget
771 juju-log "IBM WAS Base: wget downloaded and installed."
772
773-# Need to update hostname in /etc/hosts
774- private_address=`unit-get private-address`
775- juju-log "private_address : $private_address"
776- echo "$private_address `hostname`" >> /etc/hosts
777- if [ $? == 0 ];
778- then
779- juju-log "hostname updated"
780- else
781- juju-log "Error while updating /etc/hosts"
782- fi
783-
784 #Install unzip
785 juju-log "IBM WAS Base: Downloading and installng unzip."
786 apt-get install -y unzip
787 juju-log "IBM WAS Base: unzip downloaded and installed."
788
789 ARCHITECTURE=`uname -m`
790-if [ "$ARCHITECTURE" != "x86_64" ] || [ "$ARCHITECTURE" = "ppc64le" ]; then
791-juju-log "IBM WAS Base: Unsupported platform. IBM WAS Base installed with this Charm supports only the x86_64 and ppc64le platforms."
792-exit 1
793+if [ "$ARCHITECTURE" != "x86_64" -a "$ARCHITECTURE" != "ppc64le" ]; then
794+ juju-log "IBM WAS Base: Unsupported platform. IBM WAS Base installed with this Charm supports only the x86_64 and ppc64le platforms."
795+ exit 1
796 fi
797
798-juju-log "IBM WAS Base: IM and WAS packages downloaded. Awaiting acceptance of license (see README on how to accept the license)."
799-
800 juju-log "IBM WAS Base: End Install."
801
802=== modified file 'hooks/start'
803--- hooks/start 2015-07-13 10:13:52 +0000
804+++ hooks/start 2015-08-04 08:54:53 +0000
805@@ -5,16 +5,20 @@
806 #server_status=` ps -ef | grep '$WAS_BASE_INSTALL_PATH'`
807 netstat -nltp | grep 9060
808 if [ "$?" -eq "0" ];then
809-juju-log "IBM WAS Base: WAS Base Server already started"
810+ juju-log "IBM WAS Base: WAS Base Server already started"
811 else
812-cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
813- ./startServer.sh server1
814- if [ "$?" -ne "0" ]; then
815- juju-log "IBM WAS Base: Error while starting the server"
816- else
817- juju-log "IBM WAS Base: Server started successfully"
818-
819- fi
820+ if [ -d $WAS_BASE_INSTALL_PATH/profiles/test/bin ]; then
821+ cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
822+ ./startServer.sh server1
823+ if [ "$?" -ne "0" ]; then
824+ juju-log "IBM WAS Base: Error while starting the server"
825+ else
826+ juju-log "IBM WAS Base: Server started successfully"
827+ fi
828+ else
829+ juju-log "IBM WAS Base: No server to start, exiting."
830+ exit 0
831+ fi
832 fi
833
834 open-port 9060
835
836=== modified file 'hooks/stop'
837--- hooks/stop 2015-07-08 05:29:41 +0000
838+++ hooks/stop 2015-08-04 08:54:53 +0000
839@@ -3,12 +3,17 @@
840 set -e
841 WAS_BASE_INSTALL_PATH=/root/IBM/WebSphere/AppServer/V85/BASE
842
843-cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
844- ./stopServer.sh server1
845- if [ "$?" -ne "0" ]; then
846- juju-log "Error while stoping the server"
847- else
848- juju-log "Server stopped successfully"
849- fi
850+if [ -d $WAS_BASE_INSTALL_PATH/profiles/test/bin ]; then
851+ cd $WAS_BASE_INSTALL_PATH/profiles/test/bin/
852+ ./stopServer.sh server1
853+ if [ "$?" -ne "0" ]; then
854+ juju-log "Error while stoping the server"
855+ else
856+ juju-log "Server stopped successfully"
857+ fi
858+else
859+ juju-log "IBM WAS Base: No server to stop, exiting."
860+ exit 0
861+fi
862 close-port 9060
863 close-port 9443
864
865=== modified file 'hooks/website-relation-changed'
866--- hooks/website-relation-changed 2015-07-13 10:13:52 +0000
867+++ hooks/website-relation-changed 2015-08-04 08:54:53 +0000
868@@ -1,3 +1,3 @@
869 #!/bin/sh
870+relation-set hostname=`unit-get private-address` port=9060 https-port=9443
871
872-relation-set hostname=`unit-get private-address` port=9060
873
874=== modified file 'hooks/website-relation-joined'
875--- hooks/website-relation-joined 2015-07-13 10:13:52 +0000
876+++ hooks/website-relation-joined 2015-08-04 08:54:53 +0000
877@@ -8,5 +8,5 @@
878 juju-log "Delete the relation. Accept the IBM WAS Base License, as per the README, before setting up any relation."
879 exit 0
880 fi
881-relation-set hostname=`unit-get private-address` port=9060
882+relation-set hostname=`unit-get private-address` port=9060 https-port=9443
883 juju-log "IBM WAS Base: End website-relation-joined hook."
884
885=== modified file 'tests/10-bundles-test.py'
886--- tests/10-bundles-test.py 2015-07-13 10:13:52 +0000
887+++ tests/10-bundles-test.py 2015-08-04 08:54:53 +0000
888@@ -12,67 +12,64 @@
889 # Lots of prereqs on this charm (eg: java), so give it a large timeout
890 seconds_to_wait = 2400
891
892-
893 class BundleTest(unittest.TestCase):
894- """ Create a class for testing the charm in the unit test framework. """
895 @classmethod
896 def setUpClass(cls):
897- """ Set up an amulet deployment using the bundle. """
898- d=amulet.Deployment()
899-
900- local_path = os.path.join(os.path.dirname(__file__), 'local.yaml')
901- with open(local_path, "r") as fd:
902- config = yaml.safe_load(fd)
903-
904- url = config.get('wasbase').get('was_url')
905- print('Using URL %s' % url)
906- # Test if a IB url for the repository is defined
907- if not url:
908+ d = amulet.Deployment()
909+
910+ local_path = os.path.join(os.path.dirname(__file__), 'local.yaml')
911+ with open(local_path, "r") as fd:
912+ config = yaml.safe_load(fd)
913+
914+ url = config.get('wasbase').get('was_url')
915+ print('Using URL %s' % url)
916+ # Test if a IB url for the repository is defined
917+ if not url:
918 print("You need to define a url for the WAS Base packages repository.\n"
919 "Edit local.yaml or tests/00-setup and run it again.")
920 sys.exit(1)
921
922- pkg = config.get('wasbase').get('im_file_name')
923- print('Using IBM IM package %s' % pkg)
924- if not pkg:
925+ pkg = config.get('wasbase').get('im_file_name')
926+ print('Using IBM IM package %s' % pkg)
927+ if not pkg:
928 print("You need to define a package name for IBM IM.\n"
929 "Edit local.yaml or tests/00-setup and run it again.")
930 sys.exit(1)
931
932- bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml')
933- with open(bundle_path, 'r') as bundle_file:
934- contents = yaml.safe_load(bundle_file)
935- d.load(contents)
936- d.add("haproxy")
937-
938- # Software doesn't actually install until you accept the license
939- d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg })
940- d.configure('haproxy', {'enable_monitoring': True })
941- d.relate('haproxy:reverseproxy', 'was-base:website')
942- d.setup(seconds_to_wait)
943- d.sentry.wait(seconds_to_wait)
944- cls.d = d
945+ bundle_path = os.path.join(os.path.dirname(__file__), 'bundles.yaml')
946+ with open(bundle_path, 'r') as bundle_file:
947+ contents = yaml.safe_load(bundle_file)
948+ d.load(contents)
949+ d.add('haproxy')
950
951+ # Software doesn't actually install until you accept the license
952+ d.configure('was-base', {'accept-ibm-websphere-license': True, 'accept-ibm-im-license': True,'was_url': url, 'im_file_name': pkg })
953+ d.configure('haproxy', {'services': '- { service_name: was-base-service, service_host: 0.0.0.0, service_port: 9060, service_options: [balance leastconn, cookie SRVNAME insert], server_options: maxconn 100 cookie S check }'})
954+ d.relate('haproxy:reverseproxy', 'was-base:website')
955+ d.expose('haproxy')
956+ d.setup(seconds_to_wait)
957+ d.sentry.wait(seconds_to_wait)
958+ cls.d = d
959+
960 def test_deployed(self):
961- """ Test to see if the bundle deployed successfully. """
962- self.assertTrue(self.d.deployed)
963+ self.assertTrue(self.d.deployed)
964
965 def test_website(self):
966- unit = self.d.sentry.unit['was-base/0']
967- url = 'http://%s:9060/ibm/console' % unit.info['public-address']
968- response = requests.get(url)
969+ unit = self.d.sentry.unit['was-base/0']
970+ url = 'http://%s:9060/ibm/console' % unit.info['public-address']
971+ response = requests.get(url)
972 # Raise an exception if the url was not a valid web page.
973- response.raise_for_status()
974-
975+ response.raise_for_status()
976+
977 def test_reverseproxy(self):
978- unit = self.d.sentry.unit['haproxy/0']
979- url = 'http://%s:80/ibm/console' % unit.info['public-address']
980- response = requests.get(url)
981- # Raise an exception if the url was not a valid web page.
982- response.raise_for_status()
983-
984-
985-
986+ unit = self.d.sentry.unit['haproxy/0']
987+ haproxy_address = unit.info['public-address']
988+ haurl = 'http://%s:9060/ibm/console' % haproxy_address
989+ page = requests.get(haurl)
990+ # Raise an exception if the url was not a valid web page.
991+ page.raise_for_status()
992+ print('Successfully got the WAS Base web page through haproxy IP address.')
993+
994 if __name__ == '__main__':
995 unittest.main()
996
997
998=== removed file 'tests/local.yaml'
999--- tests/local.yaml 2015-07-13 10:13:52 +0000
1000+++ tests/local.yaml 1970-01-01 00:00:00 +0000
1001@@ -1,3 +0,0 @@
1002-wasbase:
1003- was_url: "http://9.124.100.99/debs/WAS-BASE"
1004- im_file_name: "Install_Mgr_v1.6.2_Lnx_WASv8.5.5.zip"

Subscribers

People subscribed via source and target branches

to all changes: