PageRenderTime 27ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/runtime/esb-manage/regress/jbiadmin02001.ksh

https://bitbucket.org/rsaqc/openesb-core
Korn Shell | 212 lines | 86 code | 40 blank | 86 comment | 0 complexity | 4b00a194eb7b565c72b9cf5c198bedba MD5 | raw file
  1. #!/bin/sh
  2. #
  3. # BEGIN_HEADER - DO NOT EDIT
  4. #
  5. # The contents of this file are subject to the terms
  6. # of the Common Development and Distribution License
  7. # (the "License"). You may not use this file except
  8. # in compliance with the License.
  9. #
  10. # You can obtain a copy of the license at
  11. # https://open-esb.dev.java.net/public/CDDLv1.0.html.
  12. # See the License for the specific language governing
  13. # permissions and limitations under the License.
  14. #
  15. # When distributing Covered Code, include this CDDL
  16. # HEADER in each file and include the License file at
  17. # https://open-esb.dev.java.net/public/CDDLv1.0.html.
  18. # If applicable add the following below this CDDL HEADER,
  19. # with the fields enclosed by brackets "[]" replaced with
  20. # your own identifying information: Portions Copyright
  21. # [year] [name of copyright owner]
  22. #
  23. #
  24. # @(#)jbiadmin02001.ksh
  25. # Copyright 2004-2008 Sun Microsystems, Inc. All Rights Reserved.
  26. #
  27. # END_HEADER - DO NOT EDIT
  28. #
  29. #jbiadmin02001 - Synchronization test cluster component configuration
  30. echo testname is jbiadmin02001
  31. . ./regress_defs.ksh
  32. my_test_domain=CAS
  33. . $SRCROOT/antbld/regress/common_defs.ksh
  34. ant -q -emacs -DESBMEMBER_ADMIN_PORT="$JBI_ADMIN_PORT" -lib "$REGRESS_CLASSPATH" -f jbiadmin01600.xml pkg.test.component
  35. # Cluster and Member Instance Setup
  36. asadmin create-cluster --port $ASADMIN_PORT $ASADMIN_PW_OPTS sccfg-cluster
  37. createClusterDelay
  38. asadmin create-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS --cluster sccfg-cluster --nodeagent agent1 sccfg-cluster-i1
  39. createInstanceDelay
  40. asadmin create-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS --cluster sccfg-cluster --nodeagent agent1 sccfg-cluster-i2
  41. createInstanceDelay
  42. asadmin start-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS sccfg-cluster-i1
  43. startInstanceDelay
  44. # Install a component
  45. $JBI_ANT_NEG -Djbi.install.file=$JV_SVC_TEST_CLASSES/dist/component-with-custom-mbean.jar -Djbi.target="sccfg-cluster" install-component
  46. installComponentDelay
  47. # Start the component
  48. $JBI_ANT_NEG -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" start-component
  49. startComponentDelay
  50. $JBI_ANT_NEG -Djbi.component.name=sun-http-binding -Djbi.target="sccfg-cluster" start-component
  51. startComponentDelay
  52. #
  53. # Application Configuration of instances versus cluster
  54. #
  55. # Add application configuration to i1
  56. asadmin create-jbi-application-configuration --port $ASADMIN_PORT $ASADMIN_PW_OPTS --target sccfg-cluster-i1 --component manage-binding-1 --configname i1Config $JV_SVC_REGRESS/deploytest/new-app-config.properties
  57. # Add application varaibles to i1
  58. asadmin create-jbi-application-variable --port $ASADMIN_PORT $ASADMIN_PW_OPTS --target sccfg-cluster-i1 --component manage-binding-1 $JV_SVC_REGRESS/deploytest/new-app-var.properties
  59. # Switch to instance 2
  60. asadmin stop-instance $ASADMIN_PW_OPTS --port $ASADMIN_PORT sccfg-cluster-i1
  61. stopInstanceDelay
  62. asadmin start-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS sccfg-cluster-i2
  63. startInstanceDelay
  64. #echo "---------------CAS registry"
  65. #cat $AS8BASE/domains/CAS/jbi/config/jbi-registry.xml
  66. #echo "---------------I1 registry"
  67. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml
  68. #echo "---------------I2 registry"
  69. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  70. echo "---------------registry diff"
  71. diff $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  72. # Add application configuration to cluster
  73. asadmin create-jbi-application-configuration --port $ASADMIN_PORT $ASADMIN_PW_OPTS --target sccfg-cluster --component manage-binding-1 --configname i1Config $JV_SVC_REGRESS/deploytest/updated-app-config.properties
  74. # Add application varaibles to cluster
  75. asadmin create-jbi-application-variable --port $ASADMIN_PORT $ASADMIN_PW_OPTS --target sccfg-cluster --component manage-binding-1 $JV_SVC_REGRESS/deploytest/update-app-var.properties
  76. # Switch to instance 1 to see if sync picks up the changes.
  77. asadmin stop-instance $ASADMIN_PW_OPTS --port $ASADMIN_PORT sccfg-cluster-i2
  78. stopInstanceDelay
  79. asadmin start-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS sccfg-cluster-i1
  80. startInstanceDelay
  81. #echo "---------------CAS registry"
  82. #cat $AS8BASE/domains/CAS/jbi/config/jbi-registry.xml
  83. #echo "---------------I1 registry"
  84. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml
  85. #echo "---------------I2 registry"
  86. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  87. echo "---------------registry diff"
  88. diff $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  89. # Make sure we get error.
  90. asadmin delete-jbi-application-configuration --port $ASADMIN_PORT $ASADMIN_PW_OPTS --target sccfg-cluster --component manage-binding-1 i1Config
  91. asadmin delete-jbi-application-variable --port $ASADMIN_PORT $ASADMIN_PW_OPTS --target sccfg-cluster --component manage-binding-1 "securityCredentials,securityPrincipal,port"
  92. # restart instance 2
  93. asadmin start-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS sccfg-cluster-i2
  94. startInstanceDelay
  95. asadmin delete-jbi-application-configuration --port $ASADMIN_PORT $ASADMIN_PW_OPTS --target sccfg-cluster --component manage-binding-1 i1Config
  96. asadmin delete-jbi-application-variable --port $ASADMIN_PORT $ASADMIN_PW_OPTS --target sccfg-cluster --component manage-binding-1 "securityCredentials,securityPrincipal,port"
  97. #echo "---------------CAS registry"
  98. #cat $AS8BASE/domains/CAS/jbi/config/jbi-registry.xml
  99. #echo "---------------I1 registry"
  100. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml
  101. #echo "---------------I2 registry"
  102. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  103. echo "---------------registry diff"
  104. diff $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  105. asadmin stop-instance $ASADMIN_PW_OPTS --port $ASADMIN_PORT sccfg-cluster-i2
  106. stopInstanceDelay
  107. #
  108. # Application Configuration of clusters.
  109. #
  110. # Add an application configuration
  111. $JBI_ANT_NEG -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$JV_SVC_REGRESS/deploytest/new-app-config.properties -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" create-application-configuration
  112. $JBI_ANT_NEG -Djbi.app.variables.file=$JV_SVC_REGRESS/deploytest/new-app-var.properties -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" create-application-variable
  113. # Add a configuration
  114. $JBI_ANT -Djbi.component.name="sun-http-binding" -Djbi.config.params.file=$JV_SVC_REGRESS/deploytest/httpbc-config-params.properties -Djbi.target=sccfg-cluster set-component-configuration
  115. # Switch to instance 2 to see if sync picks up the changes.
  116. asadmin stop-instance $ASADMIN_PW_OPTS --port $ASADMIN_PORT sccfg-cluster-i1
  117. stopInstanceDelay
  118. asadmin start-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS sccfg-cluster-i2
  119. startInstanceDelay
  120. #echo "---------------CAS registry"
  121. #cat $AS8BASE/domains/CAS/jbi/config/jbi-registry.xml
  122. #echo "---------------I1 registry"
  123. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml
  124. #echo "---------------I2 registry"
  125. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  126. echo "---------------registry diff"
  127. diff $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  128. #Update application configuration
  129. $JBI_ANT_NEG -Djbi.app.config.name=testConfig -Djbi.app.config.params.file=$JV_SVC_REGRESS/deploytest/updated-app-config.properties -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" update-application-configuration
  130. #Update application variables
  131. $JBI_ANT_NEG -Djbi.app.variables.file=$JV_SVC_REGRESS/deploytest/update-app-var.properties -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" update-application-variable
  132. #Set default component configuration
  133. $JBI_ANT -Djbi.config.params.file=$JV_SVC_REGRESS/deploytest/jbi-default-httpbc-config-params.properties -Djbi.component.name=sun-http-binding -Djbi.target=sccfg-cluster set-component-configuration
  134. # Switch to instance 1 to see if sync picks up the changes.
  135. asadmin start-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS sccfg-cluster-i1
  136. startInstanceDelay
  137. #echo "---------------CAS registry"
  138. #cat $AS8BASE/domains/CAS/jbi/config/jbi-registry.xml
  139. #echo "---------------I1 registry"
  140. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml
  141. #echo "---------------I2 registry"
  142. #cat $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  143. echo "---------------registry diff"
  144. diff $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  145. $JBI_ANT_NEG -Djbi.app.config.name=testConfig -Djbi.target="sccfg-cluster" -Djbi.component.name=manage-binding-1 delete-application-configuration
  146. # Stop instances
  147. asadmin stop-instance $ASADMIN_PW_OPTS --port $ASADMIN_PORT sccfg-cluster-i1
  148. stopInstanceDelay
  149. asadmin stop-instance $ASADMIN_PW_OPTS --port $ASADMIN_PORT sccfg-cluster-i2
  150. stopInstanceDelay
  151. echo "---------------registry diff"
  152. diff $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/jbi/config/jbi-registry.xml $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/jbi/config/jbi-registry.xml
  153. # Cleanup
  154. $JBI_ANT_NEG -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" stop-component
  155. stopComponentDelay
  156. $JBI_ANT_NEG -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" shut-down-component
  157. stopComponentDelay
  158. $JBI_ANT_NEG -Djbi.component.name=manage-binding-1 -Djbi.target="sccfg-cluster" uninstall-component
  159. uninstallComponentDelay
  160. $JBI_ANT_NEG -Djbi.component.name=sun-http-binding -Djbi.target="sccfg-cluster" stop-component
  161. stopComponentDelay
  162. $JBI_ANT_NEG -Djbi.component.name=sun-http-binding -Djbi.target="sccfg-cluster" shut-down-component
  163. stopComponentDelay
  164. # Cluster and Member Instance Cleanup
  165. cp $AS8BASE/nodeagents/agent1/sccfg-cluster-i1/logs/server.log $JV_SVC_REGRESS/../bld/2001-sccfg-cluster-i1.server.log
  166. cp $AS8BASE/nodeagents/agent1/sccfg-cluster-i2/logs/server.log $JV_SVC_REGRESS/../bld/2001-sccfg-cluster-i2.server.log
  167. asadmin delete-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS sccfg-cluster-i1
  168. deleteInstanceDelay
  169. asadmin delete-instance --port $ASADMIN_PORT $ASADMIN_PW_OPTS sccfg-cluster-i2
  170. deleteInstanceDelay
  171. asadmin delete-cluster $ASADMIN_PW_OPTS --port $ASADMIN_PORT sccfg-cluster
  172. deleteClusterDelay