Skip to content

Commit 8571d04

Browse files
author
Alex Huang
committed
unit testing is working again
1 parent 2f5bacf commit 8571d04

3 files changed

Lines changed: 47 additions & 47 deletions

File tree

‎server/test/resources/VersionDaoImplTest/clean-db.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ DROP TABLE IF EXISTS `cloud`.`vpn_users`;
117117
DROP TABLE IF EXISTS `cloud`.`network_groups`;
118118
DROP TABLE IF EXISTS `cloud`.`network_ingress_rule`;
119119
DROP TABLE IF EXISTS `cloud`.`op_nwgrp_work`;
120-
DROP TABLE IF EXISTS `cloud`.`op_vm_ruleset_log`;
120+
DROP TABLE IF EXISTS `cloud`.`op_vm_ruleset_log`;

‎setup/db/schema-21to22-cleanup.sql‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ ALTER TABLE `cloud`.`secondary_storage_vm` DROP COLUMN `vlan_id`;
8888
ALTER TABLE `cloud`.`secondary_storage_vm` DROP COLUMN `ram_size`;
8989
ALTER TABLE `cloud`.`secondary_storage_vm` DROP COLUMN `guid`;
9090

91+
#ALTER TABLE `cloud`.`vlan` ADD CONSTRAINT `fk_vlan__network_id` FOREIGN KEY `fk_vlan__network_id`(`network_id`) REFERENCES `networks`(`id`);
9192

9293
DROP TABLE `cloud`.`vm_disk`;
9394

‎setup/db/schema-21to22.sql‎

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,30 @@ CREATE TABLE `cloud`.`op_it_work` (
5050
INDEX `i_op_it_work__step`(`step`)
5151
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
5252

53-
CREATE TABLE `cloud`.`op_networks`(
54-
`id` bigint unsigned NOT NULL UNIQUE KEY,
55-
`mac_address_seq` bigint unsigned NOT NULL DEFAULT 1 COMMENT 'mac address',
56-
`nics_count` int unsigned NOT NULL DEFAULT 0 COMMENT '# of nics',
57-
`gc` tinyint unsigned NOT NULL DEFAULT 1 COMMENT 'gc this network or not',
58-
`check_for_gc` tinyint unsigned NOT NULL DEFAULT 1 COMMENT 'check this network for gc or not',
59-
PRIMARY KEY(`id`),
60-
CONSTRAINT `fk_op_networks__id` FOREIGN KEY (`id`) REFERENCES `networks`(`id`) ON DELETE CASCADE
53+
CREATE TABLE `cloud`.`network_offerings` (
54+
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
55+
`name` varchar(64) NOT NULL unique COMMENT 'network offering',
56+
`display_text` varchar(255) NOT NULL COMMENT 'text to display to users',
57+
`nw_rate` smallint unsigned COMMENT 'network rate throttle mbits/s',
58+
`mc_rate` smallint unsigned COMMENT 'mcast rate throttle mbits/s',
59+
`concurrent_connections` int(10) unsigned COMMENT 'concurrent connections supported on this network',
60+
`traffic_type` varchar(32) NOT NULL COMMENT 'traffic type carried on this network',
61+
`tags` varchar(4096) COMMENT 'tags supported by this offering',
62+
`system_only` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Is this network offering for system use only',
63+
`specify_vlan` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Should the user specify vlan',
64+
`service_offering_id` bigint unsigned UNIQUE COMMENT 'service offering id that this network offering is tied to',
65+
`created` datetime NOT NULL COMMENT 'time the entry was created',
66+
`removed` datetime DEFAULT NULL COMMENT 'time the entry was removed',
67+
`default` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if network offering is default',
68+
`availability` varchar(255) NOT NULL COMMENT 'availability of the network',
69+
`dns_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides dns service',
70+
`gateway_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides gateway service',
71+
`firewall_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides firewall service',
72+
`lb_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides lb service',
73+
`userdata_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides user data service',
74+
`vpn_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides vpn service',
75+
`dhcp_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides dhcp service',
76+
PRIMARY KEY (`id`)
6177
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
6278

6379
CREATE TABLE `cloud`.`networks` (
@@ -96,6 +112,16 @@ CREATE TABLE `cloud`.`networks` (
96112
CONSTRAINT `fk_networks__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `domain`(`id`)
97113
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
98114

115+
CREATE TABLE `cloud`.`op_networks`(
116+
`id` bigint unsigned NOT NULL UNIQUE KEY,
117+
`mac_address_seq` bigint unsigned NOT NULL DEFAULT 1 COMMENT 'mac address',
118+
`nics_count` int unsigned NOT NULL DEFAULT 0 COMMENT '# of nics',
119+
`gc` tinyint unsigned NOT NULL DEFAULT 1 COMMENT 'gc this network or not',
120+
`check_for_gc` tinyint unsigned NOT NULL DEFAULT 1 COMMENT 'check this network for gc or not',
121+
PRIMARY KEY(`id`),
122+
CONSTRAINT `fk_op_networks__id` FOREIGN KEY (`id`) REFERENCES `networks`(`id`) ON DELETE CASCADE
123+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
124+
99125
CREATE TABLE `cloud`.`account_network_ref` (
100126
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
101127
`account_id` bigint unsigned NOT NULL COMMENT 'account id',
@@ -143,31 +169,7 @@ CREATE TABLE `cloud`.`nics` (
143169
CONSTRAINT `fk_nics__networks_id` FOREIGN KEY `fk_nics__networks_id`(`network_id`) REFERENCES `networks`(`id`)
144170
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
145171

146-
CREATE TABLE `cloud`.`network_offerings` (
147-
`id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
148-
`name` varchar(64) NOT NULL unique COMMENT 'network offering',
149-
`display_text` varchar(255) NOT NULL COMMENT 'text to display to users',
150-
`nw_rate` smallint unsigned COMMENT 'network rate throttle mbits/s',
151-
`mc_rate` smallint unsigned COMMENT 'mcast rate throttle mbits/s',
152-
`concurrent_connections` int(10) unsigned COMMENT 'concurrent connections supported on this network',
153-
`traffic_type` varchar(32) NOT NULL COMMENT 'traffic type carried on this network',
154-
`tags` varchar(4096) COMMENT 'tags supported by this offering',
155-
`system_only` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Is this network offering for system use only',
156-
`specify_vlan` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Should the user specify vlan',
157-
`service_offering_id` bigint unsigned UNIQUE COMMENT 'service offering id that this network offering is tied to',
158-
`created` datetime NOT NULL COMMENT 'time the entry was created',
159-
`removed` datetime DEFAULT NULL COMMENT 'time the entry was removed',
160-
`default` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if network offering is default',
161-
`availability` varchar(255) NOT NULL COMMENT 'availability of the network',
162-
`dns_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides dns service',
163-
`gateway_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides gateway service',
164-
`firewall_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides firewall service',
165-
`lb_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides lb service',
166-
`userdata_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides user data service',
167-
`vpn_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides vpn service',
168-
`dhcp_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if network offering provides dhcp service',
169-
PRIMARY KEY (`id`)
170-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
172+
INSERT INTO `network_offerings` VALUES (1,'System-Public-Network','System Offering for System-Public-Network',NULL,NULL,NULL,'Public',NULL,1,0,NULL,'2011-02-28 17:46:55',NULL,0,'Required',0,0,0,0,0,0,0),(2,'System-Management-Network','System Offering for System-Management-Network',NULL,NULL,NULL,'Management',NULL,1,0,NULL,'2011-02-28 17:46:55',NULL,0,'Required',0,0,0,0,0,0,0),(3,'System-Control-Network','System Offering for System-Control-Network',NULL,NULL,NULL,'Control',NULL,1,0,NULL,'2011-02-28 17:46:55',NULL,0,'Required',0,0,0,0,0,0,0),(4,'System-Storage-Network','System Offering for System-Storage-Network',NULL,NULL,NULL,'Storage',NULL,1,0,NULL,'2011-02-28 17:46:55',NULL,0,'Required',0,0,0,0,0,0,0),(5,'System-Guest-Network','System-Guest-Network',NULL,NULL,NULL,'Guest',NULL,1,0,NULL,'2011-02-28 17:46:56',NULL,1,'Required',1,0,0,0,1,0,1),(6,'DefaultVirtualizedNetworkOffering','Virtual Vlan',NULL,NULL,NULL,'Guest',NULL,0,0,NULL,'2011-02-28 17:46:56',NULL,1,'Required',1,1,1,1,1,1,1),(7,'DefaultDirectNetworkOffering','Direct',NULL,NULL,NULL,'Guest',NULL,0,0,NULL,'2011-02-28 17:46:56',NULL,1,'Required',1,0,0,0,1,0,1);
171173

172174
CREATE TABLE `cloud`.`cluster_details` (
173175
`id` bigint unsigned NOT NULL auto_increment,
@@ -186,16 +188,6 @@ ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `mac_address` bigint unsigned N
186188
ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `source_network_id` bigint unsigned NOT NULL;
187189
ALTER TABLE `cloud`.`user_ip_address` ADD COLUMN `network_id` bigint unsigned;
188190

189-
CREATE TABLE `cloud`.`port_forwarding_rules` (
190-
`id` bigint unsigned NOT NULL COMMENT 'id',
191-
`instance_id` bigint unsigned NOT NULL COMMENT 'vm instance id',
192-
`dest_ip_address` char(40) NOT NULL COMMENT 'id_address',
193-
`dest_port_start` int(10) NOT NULL COMMENT 'starting port of the port range to map to',
194-
`dest_port_end` int(10) NOT NULL COMMENT 'end port of the the port range to map to',
195-
PRIMARY KEY (`id`),
196-
CONSTRAINT `fk_port_forwarding_rules__id` FOREIGN KEY(`id`) REFERENCES `firewall_rules`(`id`) ON DELETE CASCADE
197-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
198-
199191
CREATE TABLE `cloud`.`firewall_rules` (
200192
`id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
201193
`ip_address_id` bigint unsigned NOT NULL COMMENT 'id of the corresponding ip address',
@@ -216,6 +208,16 @@ CREATE TABLE `cloud`.`firewall_rules` (
216208
CONSTRAINT `fk_firewall_rules__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE
217209
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
218210

211+
CREATE TABLE `cloud`.`port_forwarding_rules` (
212+
`id` bigint unsigned NOT NULL COMMENT 'id',
213+
`instance_id` bigint unsigned NOT NULL COMMENT 'vm instance id',
214+
`dest_ip_address` char(40) NOT NULL COMMENT 'id_address',
215+
`dest_port_start` int(10) NOT NULL COMMENT 'starting port of the port range to map to',
216+
`dest_port_end` int(10) NOT NULL COMMENT 'end port of the the port range to map to',
217+
PRIMARY KEY (`id`),
218+
CONSTRAINT `fk_port_forwarding_rules__id` FOREIGN KEY(`id`) REFERENCES `firewall_rules`(`id`) ON DELETE CASCADE
219+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
220+
219221
CREATE TABLE `cloud`.`load_balancing_rules` (
220222
`id` bigint unsigned NOT NULL,
221223
`name` varchar(255) NOT NULL,
@@ -238,8 +240,6 @@ CREATE TABLE `cloud`.`op_host` (
238240

239241
INSERT INTO op_host(id, sequence) select id, sequence from host;
240242

241-
242-
243243
-- Alter Tables to add Columns;
244244

245245
ALTER TABLE `cloud`.`cluster` ADD COLUMN `hypervisor_type` varchar(32);
@@ -258,7 +258,6 @@ UPDATE `cloud`.`volumes` SET state='Ready' WHERE removed IS NULL AND destroyed=0
258258
ALTER TABLE `cloud`.`volumes` MODIFY COLUMN `state` VARCHAR(32) NOT NULL;
259259

260260
ALTER TABLE `cloud`.`vlan` ADD COLUMN `network_id` bigint unsigned NOT NULL;
261-
ALTER TABLE `cloud`.`vlan` ADD CONSTRAINT `fk_vlan__network_id` FOREIGN KEY `fk_vlan__network_id`(`network_id`) REFERENCES `networks`(`id`);
262261
ALTER TABLE `cloud`.`vlan` ADD CONSTRAINT `fk_vlan__data_center_id` FOREIGN KEY `fk_vlan__data_center_id`(`data_center_id`) REFERENCES `data_center`(`id`);
263262

264263
ALTER TABLE `cloud`.`data_center` ADD COLUMN `domain` varchar(100);

0 commit comments

Comments
 (0)