自动化测试框架爱好者,非培训机构、非托、非盈利,纯个人!软件自动化测试交流 请加我QQ 459864689!更多自动化测试的信息请访问我的个人小站www.zhushangyuan.cn,专门研究selenium自动化测试框架的分享站点。

WebSphere测试环境管理脚本

上一篇 / 下一篇  2009-03-26 19:22:04 / 个人分类:WebSphere

51Testing软件测试网 h1c z7L qzg


;J7aF c7q0#########Set the following variables before using the shell file#####################
&B7f(F+Y xE*p"fsH3|0#########your working profile directory#########
3a HJvn8v\~(Hj0export wps_home=/opt/WAS6025/profiles
`{c'y0~EN0export profileName=myProfile
}Q3LO-mB/`,A,i^0export  wps_profile_root=${wps_home}/${profileName}
"XX'z7A-k0#########your backup profile directory#########
C RI7Ebd Qin0export  wps_profile_bak_root=${wps_home}/myProfile_backup51Testing软件测试网8}6n p7}Wl#I c @o
#########system username and password#########51Testing软件测试网m:}1T O;hhx
export  username=root51Testing软件测试网^b5v'sA*i-Q
export  password=passw0rd51Testing软件测试网StA8h4lZE a
####################################################################################51Testing软件测试网"j,J#lQGxM

_y2r!iw0aw0choice0(){51Testing软件测试网7\4]`+C3d8F5e5~ Hp
         netstat -an|grep 9060 >/dev/null&&echo "        The server is running"
4H/?JM2a1kv0         netstat -an|grep 9060 >/dev/null||echo "        No  server is running"
+C2yDg lmx P0}51Testing软件测试网&?![!@~E@K5p
choice1(){
hsIg&U2O"Y0        cd  ${wps_profile_root}/bin51Testing软件测试网[m5vJv[([2pcn
        ./startServer.sh server1 -username ${username} -password ${password}51Testing软件测试网'fb@? T jJn
}
N,Qxz1M0choice2(){51Testing软件测试网 _$J@Wo[V
        cd  ${wps_profile_root}/bin51Testing软件测试网(_6W!GR)kJS0yl
        ./stopServer.sh server1 -username ${username} -password ${password}51Testing软件测试网Gu#x1c7Z+JrQ
}
K7z]:~ l!N0choice3(){
t,V~ R8AU4Nh0        cd  ${wps_profile_root}/bin51Testing软件测试网OY-S/K,c
        ./wsadmin.sh -conntype NONE -c securityoff51Testing软件测试网 Jk&e'oi5Dz
}
BhDG(O'Vf0choice4(){51Testing软件测试网6I'V n7R+\g
        cd  ${wps_profile_root}/bin
;xaB"H0TQyo z6\0        ./startServer.sh server1 -username ${username} -password ${password}51Testing软件测试网:[ I%u-w!v e
        ./wsadmin.sh -c "securityon ${username} ${password}"51Testing软件测试网iK5pOTl2^X
}
9IS5@K7m0choice5(){51Testing软件测试网,P1? Z5rrK*G
        choice251Testing软件测试网2uSZ+V#MU&[rf
        sleep 1051Testing软件测试网ozSE"f uaV0X
        echo removing profile……51Testing软件测试网#|pT-?q4}G
        cd ${wps_home}
%U/Ep,w1M(m8b e0        rm -r ${profileName}51Testing软件测试网i x1AC6_c0O9P/u)N
        echo coping profile……
:}U;b7Q mL/`4Q.x8K)E0        cd ${wps_home}51Testing软件测试网i!? `-Ac5}b
        pwd51Testing软件测试网|fVlo%x9JjCM[
        cp -r ${wps_profile_bak_root} ${profileName}
3R/xA_IC g:NL6~0}51Testing软件测试网-g {I"Sf"e,JQ
choice6(){51Testing软件测试网"D1yx)hG#] C.Ey5]
        endmqlsr -m QMgr51Testing软件测试网ZY8N_2W
        endmqm -i QMgr
S+B&L,l ?+p0        dltmqm QMgr
^XQ@~u)N_q0       
j$`%d+AEfW#e0        endmqlsr -m TestQM_cln
/Z_w R/? c{6S i0        endmqm -i TestQM_cln51Testing软件测试网l)?EA:B,s
        dltmqm TestQM_cln
k_7e1L w4dx6x#oP0       
N.q$e3e1Up A(J u0        endmqlsr -m TestQM_bnd51Testing软件测试网6t)n0Fq;@!c*\ Yh0d
        endmqm -i TestQM_bnd
)^3X%d R]/j]l0        dltmqm TestQM_bnd51Testing软件测试网f7g_#W+Ma$s
}
5^AkR4bgp0choice7(){
8L3D \'JS#hhe0          choice651Testing软件测试网h#\-P,@Uq!w1\4R
          crtmqm -q QMgr51Testing软件测试网 Y4Z5kYA5cP:z-v
          strmqm QMgr51Testing软件测试网1UDaTSz
          runmqlsr -t TCP -p 1414 -m QMgr &
Si$@2s-Q*Iw5L0          echo ALTER QMGR ccsid\(1208\)>>config_mq.tmp51Testing软件测试网!e7o`2Y z"S%[0|
          echo END >>config_mq.tmp51Testing软件测试网 y/iS;t&\p
          runmqsc QMgr < config_mq.tmp51Testing软件测试网 l(R2n$Z8u$t+D$c%a
          rm config_mq.tmp51Testing软件测试网V+l+He@:\
}

tF"cM&C0

~\fL @0make_choices() {
5Mh P q@c5@o M0   while true; do51Testing软件测试网-tdvy'I
       echo51Testing软件测试网o5g1U8Z [O:sv
       echo     "  WPS work common operations available:"       
Ww#Q8aa-P3u0       echo   "   serverStatus:           0"
I^;\|b4u0       echo   "   startServer:            1"51Testing软件测试网SC6r-o5K4{#Y
       echo   "   stopServer :            2"
u:@j4_ N X6h+F|7@0       echo   "   disable security:       3"51Testing软件测试网T+j*`G!l,D+\]+Uz
       echo   "   enable security  :      4"
yZ0H_-AQ3Z$IH0       echo   "   restore profile files:  5"51Testing软件测试网E%nWo }'h^`/v
       echo   "   QMgrDelete       :      6"51Testing软件测试网X \N"G3^%n/[e
       echo   "   QMgrCreate           :  7"
gd*|Ki0       echo   "   quit               :    x"51Testing软件测试网0vP/_(Vx"w/Ey,Q
       echo "Please TYPE your choice for your operation?"      51Testing软件测试网.j&Sg;T5h)rD6r
      read answer51Testing软件测试网&j!FA)xBd
      if [ -z "$answer" ]; then51Testing软件测试网*qw g'~$w;?6Q#b
         echo
b4{T&DG3eQ)b7O0         echo "Error: a response is required."51Testing软件测试网K.i#Vq d8TR r7D
         echo
.h7d1z7x;{'T`5|PKG0         continue51Testing软件测试网/j@1v:R(V#P
      elif [ "$answer" = "0" ]; then
6xrUf3S qZ([7o0        echo You TYPE $answer for serverStatus!
w6?NOy6ET0        choice051Testing软件测试网v4Tx:s"QNTp&s
        continue51Testing软件测试网 A.t'KjYt-]X
      elif [ "$answer" = "1" ]; then51Testing软件测试网!J@Im5|HZJ
        echo You TYPE $answer for startServer!
f6D jv#IQn K F0        choice1
z%i%YC E}8w0}c0        continue51Testing软件测试网'}.J i(A X_ k
      elif [ "$answer" = "2" ]; then
n.S)n0W5t0        echo You TYPE $answer for stopServer!
!dU;NN{y$Si+l0        choice251Testing软件测试网p/SzNO9A
        continue
zs b T u0      elif [ "$answer" = "3" ]; then51Testing软件测试网 bCaC"a-D T&V
        echo You TYPE $answer for disable security!51Testing软件测试网;YQnS;Q E4QVPa
         choice351Testing软件测试网5n*x#Yzs8KR1{
        continue
{9@?NAQ/vpD0      elif [ "$answer" = "4" ]; then51Testing软件测试网%ov c.j8_E_"UN(U4{+q
        echo You TYPE $answer for enable security !51Testing软件测试网!vNB1qaT-T
         choice451Testing软件测试网 _hHd%ER
        continue51Testing软件测试网T8w aY u7D$B!s
      elif [ "$answer" = "5" ]; then51Testing软件测试网z a ]9T"K)y^&e0_
        echo You TYPE $answer for restore profile files!51Testing软件测试网Mnf+f5]i?Q&X
         choice551Testing软件测试网V[0e y |&|"BQ1k
        continue
"Z3Lo Yka)n.A0      elif [ "$answer" = "6" ]; then
%S*I9_H"NArs0        echo You TYPE $answer for QMgrDelete !
u4GU`^/`*N"w0         choice6
]a6?K4i0R;^}0        continue51Testing软件测试网,nG;tG(i l[ M(e
      elif [ "$answer" = "7" ]; then51Testing软件测试网!W]^bK4C J,F-C
        echo You TYPE $answer for QMgrCreate !51Testing软件测试网 R L!O`C{ SH U
         choice7
9Yx?0CT/l[4[&K0        continue51Testing软件测试网G5G/pIX}
      elif [ "$answer" = "x" ]; then
g3uj4t ~I+Jg0        break51Testing软件测试网5FX7x!QR"O2`
      else51Testing软件测试网[1HJM8yY\$Ib
         echo51Testing软件测试网jLes1ds
         echo "Error: you must enter the correct choices ."
(l-c'vq|;Q"]&]|8|0         echo
(w+tne6UYk)t0         continue51Testing软件测试网ll4W _#Pq3Ix
      fi
!m A7K0g5R0   done51Testing软件测试网e(Mv.FKx/eCf?
}51Testing软件测试网!h zm n Su6b q

51Testing软件测试网IKVz(vz

make_choices

0?!puz,is0

TAG:

 

评分:0

我来说两句

Open Toolbar