Skip to content

Commit d36a988

Browse files
committed
move simulator/test to opensource
1 parent 4b6d072 commit d36a988

268 files changed

Lines changed: 80347 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agent-simulator/.classpath

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="lib" path="/deps/cloud-log4j.jar"/>
6+
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
7+
<classpathentry combineaccessrules="false" kind="src" path="/api"/>
8+
<classpathentry combineaccessrules="false" kind="src" path="/server"/>
9+
<classpathentry combineaccessrules="false" kind="src" path="/utils"/>
10+
<classpathentry combineaccessrules="false" kind="src" path="/agent"/>
11+
<classpathentry kind="lib" path="/deps/cloud-gson.jar"/>
12+
<classpathentry combineaccessrules="false" kind="src" path="/core-premium"/>
13+
<classpathentry combineaccessrules="false" kind="src" path="/premium"/>
14+
<classpathentry combineaccessrules="false" kind="src" path="/agent-premium"/>
15+
<classpathentry combineaccessrules="false" kind="src" path="/console"/>
16+
<classpathentry combineaccessrules="false" kind="src" path="/console-proxy"/>
17+
<classpathentry combineaccessrules="false" kind="src" path="/console-viewer"/>
18+
<classpathentry combineaccessrules="false" kind="src" path="/deps"/>
19+
<classpathentry combineaccessrules="false" kind="src" path="/setup"/>
20+
<classpathentry combineaccessrules="false" kind="src" path="/test"/>
21+
<classpathentry combineaccessrules="false" kind="src" path="/thirdparty"/>
22+
<classpathentry combineaccessrules="false" kind="src" path="/tools"/>
23+
<classpathentry combineaccessrules="false" kind="src" path="/ui"/>
24+
<classpathentry combineaccessrules="false" kind="src" path="/usage"/>
25+
<classpathentry combineaccessrules="false" kind="src" path="/vmopsClient"/>
26+
<classpathentry combineaccessrules="false" kind="src" path="/vmware-base"/>
27+
<classpathentry kind="output" path="bin"/>
28+
</classpath>

agent-simulator/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>agent-simulator</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
DROP TABLE IF EXISTS `cloud`.`mockhost`;
2+
DROP TABLE IF EXISTS `cloud`.`mocksecstorage`;
3+
DROP TABLE IF EXISTS `cloud`.`mockstoragepool`;
4+
DROP TABLE IF EXISTS `cloud`.`mockvm`;
5+
DROP TABLE IF EXISTS `cloud`.`mockvolume`;
6+
7+
CREATE TABLE `cloud`.`mockhost` (
8+
`id` bigint unsigned NOT NULL auto_increment,
9+
`name` varchar(255) NOT NULL,
10+
`private_ip_address` char(40),
11+
`private_mac_address` varchar(17),
12+
`private_netmask` varchar(15),
13+
`storage_ip_address` char(40),
14+
`storage_netmask` varchar(15),
15+
`storage_mac_address` varchar(17),
16+
`public_ip_address` char(40),
17+
`public_netmask` varchar(15),
18+
`public_mac_address` varchar(17),
19+
`guid` varchar(255) UNIQUE,
20+
`version` varchar(40) NOT NULL,
21+
`data_center_id` bigint unsigned NOT NULL,
22+
`pod_id` bigint unsigned,
23+
`cluster_id` bigint unsigned COMMENT 'foreign key to cluster',
24+
`cpus` int(10) unsigned,
25+
`speed` int(10) unsigned,
26+
`ram` bigint unsigned,
27+
`capabilities` varchar(255) COMMENT 'host capabilities in comma separated list',
28+
`vm_id` bigint unsigned,
29+
`resource` varchar(255) DEFAULT NULL COMMENT 'If it is a local resource, this is the class name',
30+
PRIMARY KEY (`id`)
31+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
32+
33+
CREATE TABLE `cloud`.`mocksecstorage` (
34+
`id` bigint unsigned NOT NULL auto_increment,
35+
`url` varchar(255),
36+
`capacity` bigint unsigned,
37+
`mount_point` varchar(255),
38+
PRIMARY KEY (`id`)
39+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
40+
41+
CREATE TABLE `cloud`.`mockstoragepool` (
42+
`id` bigint unsigned NOT NULL auto_increment,
43+
`guid` varchar(255),
44+
`mount_point` varchar(255),
45+
`capacity` bigint,
46+
`pool_type` varchar(40),
47+
PRIMARY KEY (`id`)
48+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
49+
50+
51+
CREATE TABLE `cloud`.`mockvm` (
52+
`id` bigint unsigned NOT NULL auto_increment,
53+
`name` varchar(255),
54+
`host_id` bigint unsigned,
55+
`type` varchar(40),
56+
`state` varchar(40),
57+
`vnc_port` bigint unsigned,
58+
`memory` bigint unsigned,
59+
`cpu` bigint unsigned,
60+
PRIMARY KEY (`id`)
61+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
62+
63+
64+
CREATE TABLE `cloud`.`mockvolume` (
65+
`id` bigint unsigned NOT NULL auto_increment,
66+
`name` varchar(255),
67+
`size` bigint unsigned,
68+
`path` varchar(255),
69+
`pool_id` bigint unsigned,
70+
`type` varchar(40),
71+
PRIMARY KEY (`id`)
72+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
73+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
#
3+
# Copyright (C) 2011 Cloud.com, Inc. All rights reserved.
4+
#
5+
6+
7+
x=$1
8+
9+
pod_query="GET http://10.91.30.226:8096/client/?command=deletePod&id=$x HTTP/1.0\n\n"
10+
11+
12+
echo -e $pod_query | nc -v -q 20 10.91.30.226 8096
13+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
#
3+
# Copyright (C) 2011 Cloud.com, Inc. All rights reserved.
4+
#
5+
6+
7+
x=$1
8+
9+
delete_so="GET http://10.91.30.226:8096/client/?command=deleteServiceOffering&id=$x HTTP/1.0\n\n"
10+
11+
echo -e $delete_so | nc -v -q 20 10.91.30.226 8096
12+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
#
3+
# Copyright (C) 2011 Cloud.com, Inc. All rights reserved.
4+
#
5+
6+
7+
x=$1
8+
9+
vlan_query="GET http://10.91.30.226:8096/client/?command=deleteVlanIpRange&id=$x HTTP/1.0\n\n"
10+
11+
12+
echo -e $vlan_query | nc -v -q 20 10.91.30.226 8096
13+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
#
3+
# Copyright (C) 2011 Cloud.com, Inc. All rights reserved.
4+
#
5+
6+
7+
zoneid=$1
8+
templateId=$2
9+
serviceOfferingId=$3
10+
11+
query="GET http://10.91.30.226:8096/client/?command=deployVirtualMachine&zoneId=$1&templateId=$2&serviceOfferingId=$3&account=admin&domainid=1 HTTP/1.0\n\n"
12+
13+
echo -e $query | nc -v -q 20 10.91.30.226 8096
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
#
3+
# Copyright (C) 2011 Cloud.com, Inc. All rights reserved.
4+
#
5+
6+
7+
query="GET http://10.91.30.226:8096/client/?command=listRouters&zoneId=$1&account=admin&domainid=1 HTTP/1.0\n\n"
8+
9+
echo -e $query | nc -v 10.91.30.226 8096
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
#
3+
# Copyright (C) 2011 Cloud.com, Inc. All rights reserved.
4+
#
5+
6+
7+
query="GET http://10.91.28.33:8096/client/?command=listVirtualMachines&zoneId=$1&account=admin&domainid=1 HTTP/1.0\n\n"
8+
9+
echo -e $query | nc -v -q 20 10.91.28.33 8096
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2011 Citrix Systems, Inc. All rights reserved
4+
#
5+
#
6+
# This software is licensed under the GNU General Public License v3 or later.
7+
#
8+
# It is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation, either version 3 of the License, or any later version.
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
#
19+
#
20+
21+
22+
usage() {
23+
printf "Query job result Usage: %s: -h management-server -j jobid\n" $(basename $0) >&2
24+
}
25+
26+
#options
27+
jflag=
28+
hflag=
29+
30+
jobid=
31+
host="127.0.0.1" #defaults to localhost
32+
33+
while getopts 'h:j:' OPTION
34+
do
35+
case $OPTION in
36+
h) hflag=1
37+
host="$OPTARG"
38+
;;
39+
j) jflag=1
40+
jobid="$OPTARG"
41+
;;
42+
?) usage
43+
exit 2
44+
;;
45+
esac
46+
done
47+
48+
if [ $jflag != "1" ]
49+
then
50+
usage
51+
exit 2
52+
fi
53+
54+
55+
job_query="GET http://$host:8096/client/?command=queryAsyncJobResult&jobid=$jobid HTTP/1.0\n\n"
56+
echo -e $job_query | nc -v -w 60 $host 8096

0 commit comments

Comments
 (0)