Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 132 lines (122 sloc) 5.654 kb
95ffa67 Sang-Min Park quick ha test scripts
sangmin authored
1 #!/usr/bin/perl
df1fb37 Garrett Holmstrom Update GPL file headers
gholms authored
2
3 # Copyright 2009-2012 Eucalyptus Systems, Inc.
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 3 of the License.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see http://www.gnu.org/licenses/.
16 #
17 # Please contact Eucalyptus Systems, Inc., 6755 Hollister Ave., Goleta
18 # CA 93117, USA or visit http://www.eucalyptus.com/licenses/ if you need
19 # additional information or have any questions.
47b5fb5 Garrett Holmstrom Tweak GPL headers
gholms authored
20 #
21 # This file may incorporate work covered under the following copyright
22 # and permission notice:
23 #
24 # Software License Agreement (BSD License)
25 #
26 # Copyright (c) 2008, Regents of the University of California
27 # All rights reserved.
28 #
29 # Redistribution and use of this software in source and binary forms,
30 # with or without modification, are permitted provided that the
31 # following conditions are met:
32 #
33 # Redistributions of source code must retain the above copyright
34 # notice, this list of conditions and the following disclaimer.
35 #
36 # Redistributions in binary form must reproduce the above copyright
37 # notice, this list of conditions and the following disclaimer
38 # in the documentation and/or other materials provided with the
39 # distribution.
40 #
41 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
42 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
43 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
44 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
45 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
46 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
47 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
49 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
51 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
52 # POSSIBILITY OF SUCH DAMAGE. USERS OF THIS SOFTWARE ACKNOWLEDGE
53 # THE POSSIBLE PRESENCE OF OTHER OPEN SOURCE LICENSED MATERIAL,
54 # COPYRIGHTED MATERIAL OR PATENTED MATERIAL IN THIS SOFTWARE,
55 # AND IF ANY SUCH MATERIAL IS DISCOVERED THE PARTY DISCOVERING
56 # IT MAY INFORM DR. RICH WOLSKI AT THE UNIVERSITY OF CALIFORNIA,
57 # SANTA BARBARA WHO WILL THEN ASCERTAIN THE MOST APPROPRIATE REMEDY,
58 # WHICH IN THE REGENTS' DISCRETION MAY INCLUDE, WITHOUT LIMITATION,
59 # REPLACEMENT OF THE CODE SO IDENTIFIED, LICENSING OF THE CODE SO
60 # IDENTIFIED, OR WITHDRAWAL OF THE CODE CAPABILITY TO THE EXTENT
61 # NEEDED TO COMPLY WITH ANY SUCH LICENSES OR RIGHTS.
df1fb37 Garrett Holmstrom Update GPL file headers
gholms authored
62
95ffa67 Sang-Min Park quick ha test scripts
sangmin authored
63 sub describe_services {
64 test_start("euca-describe-services");
65 run_on_clc("$euca_dir/usr/sbin/euca-describe-services", "euca-describe-services failed");
66 test_end();
67 }
68
342c3d4 add db connection pool check; combine cluster proxy state check
grze@eucalyptus.com authored
69 sub cluster_proxy_state {
70 test_start("list cluster proxy states");
f6cca45 tweaks to quick_ha.pl: combine cluster proxy checks, db connection pool ...
grze@eucalyptus.com authored
71 run_on_clc("$euca_dir/usr/sbin/euca-modify-property -p euca=\'[\\\"enabled\\\":com.eucalyptus.cluster.Clusters.getInstance().listValues().collect{ it.stateMachine }, \\\"disabled\\\":com.eucalyptus.cluster.Clusters.getInstance().listDisabledValues().collect{ it.stateMachine }]\'",
95ffa67 Sang-Min Park quick ha test scripts
sangmin authored
72 "listing failed");
73 test_end();
74 }
75
f6cca45 tweaks to quick_ha.pl: combine cluster proxy checks, db connection pool ...
grze@eucalyptus.com authored
76 sub db_connections {
77 test_start("check database connection states");
3be9eaa tweaks to quick_ha.pl: combine cluster proxy checks, db connection pool ...
grze@eucalyptus.com authored
78 run_on_clc("$euca_dir/usr/sbin/euca-modify-property -p euca=\'com.eucalyptus.entities.PersistenceContexts.list().collect{ \\\"\\\\n\\\" + it + \\\"=> ENABLED \\\" + com.eucalyptus.bootstrap.Databases.lookup(it).getActiveDatabases() + \\\" DISABLED \\\" + com.eucalyptus.bootstrap.Databases.lookup(it).getInactiveDatabases() }\'","failed to get database connection pool info.");
f6cca45 tweaks to quick_ha.pl: combine cluster proxy checks, db connection pool ...
grze@eucalyptus.com authored
79 test_end();
80 }
81
95ffa67 Sang-Min Park quick ha test scripts
sangmin authored
82 sub drbd_dstate {
83 test_start("drbd dstate");
7c52862 Sang-Min Park quick_ha: added drbadadm role all
sangmin authored
84 run_on_clc("drbdadm dstate all", "drbdadm dstate failed");
95ffa67 Sang-Min Park quick ha test scripts
sangmin authored
85 test_end();
86 }
87
88 sub drbd_cstate {
89 test_start("drbd cstate");
7c52862 Sang-Min Park quick_ha: added drbadadm role all
sangmin authored
90 run_on_clc("drbdadm state all", "drbdadm cstate failed");
95ffa67 Sang-Min Park quick ha test scripts
sangmin authored
91 test_end();
92 }
93
84e5723 Sang-Min Park more test in quick ha
sangmin authored
94 sub check_mysqld {
95 test_start("if mysqld is running on clc");
96 check_on_clc("ps afx | grep mysqld | grep -v grep");
97 test_end();
98 }
99
639dfaa add hostMap to quick_cloud.pl
grze@eucalyptus.com authored
100 sub host_membership {
fb0de6a add hostMap to quick_cloud.pl
grze@eucalyptus.com authored
101 test_start("host membership map");
47ead1b print full host info
grze@eucalyptus.com authored
102 run_on_clc("$euca_dir/usr/sbin/euca-modify-property -p euca=\'com.eucalyptus.bootstrap.Hosts.hostMap.values().collect{ it }\'");
639dfaa add hostMap to quick_cloud.pl
grze@eucalyptus.com authored
103 test_end();
104 }
2ce295f add gms members to quick_cloud.pl
grze@eucalyptus.com authored
105 sub gms_members {
106 test_start("GMS membership list");
107 run_on_clc("$euca_dir/usr/sbin/euca-modify-property -p euca=\'com.eucalyptus.bootstrap.Hosts.hostMap.getChannel( ).getView( ).getMembers( )\'");
108 test_end();
109 }
84e5723 Sang-Min Park more test in quick ha
sangmin authored
110 sub coordinator_local {
111 test_start("is coordinator?");
7d28c03 tweaks to quick_ha.pl: combine cluster proxy checks, db connection pool ...
grze@eucalyptus.com authored
112 run_on_clc("$euca_dir/usr/sbin/euca-modify-property -p euca=\'\\\"Coordinator: \\\" + com.eucalyptus.bootstrap.Hosts.isCoordinator() + \\\" => \\\" + com.eucalyptus.bootstrap.Hosts.getCoordinator()\'");
00456f8 fix to clc initialization for local vs. remote
grze@eucalyptus.com authored
113 run_on_clc("$euca_dir/usr/sbin/euca-modify-property -p euca=\'\\\"Localhost: => \\\" + com.eucalyptus.bootstrap.Hosts.localHost()\'");
84e5723 Sang-Min Park more test in quick ha
sangmin authored
114 test_end();
115 }
116
7c52862 Sang-Min Park quick_ha: added drbadadm role all
sangmin authored
117 sub drbd_role {
118 test_start("drbdadm role all");
119 run_on_clc("drbdadm role all", "rbdadm role all failed");
120 test_end();
121 }
639dfaa add hostMap to quick_cloud.pl
grze@eucalyptus.com authored
122 &host_membership;
2ce295f add gms members to quick_cloud.pl
grze@eucalyptus.com authored
123 &gms_members;
639dfaa add hostMap to quick_cloud.pl
grze@eucalyptus.com authored
124 &coordinator_local;
95ffa67 Sang-Min Park quick ha test scripts
sangmin authored
125 &describe_services;
f6cca45 tweaks to quick_ha.pl: combine cluster proxy checks, db connection pool ...
grze@eucalyptus.com authored
126 &cluster_proxy_state;
95ffa67 Sang-Min Park quick ha test scripts
sangmin authored
127 &drbd_dstate;
128 &drbd_cstate;
7c52862 Sang-Min Park quick_ha: added drbadadm role all
sangmin authored
129 &drbd_role;
639dfaa add hostMap to quick_cloud.pl
grze@eucalyptus.com authored
130 &check_mysqld;
131 &db_connections;
Something went wrong with that request. Please try again.