Skip to content

Commit c578503

Browse files
phudtranzasherif
authored andcommitted
Added more tests for scaled endpoint
1 parent bbf6afe commit c578503

File tree

3 files changed

+147
-0
lines changed

3 files changed

+147
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (c) 2019 The Authors.
2+
#
3+
# Authors: Sherif Abdelwahab <@zasherif>
4+
# Phu Tran <@phudtran>
5+
#
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
9+
# License for the specific language governing permissions and limitations
10+
# under the License.
11+
12+
from test.trn_controller.controller import controller
13+
from test.trn_controller.droplet import droplet
14+
from test.trn_controller.common import cidr
15+
from test.trn_func_tests.helper import *
16+
import unittest
17+
from time import sleep
18+
19+
20+
class test_scaled_endpoint_bouncer_on_client_diff_conn(unittest.TestCase):
21+
22+
def setUp(self):
23+
self.droplets = {
24+
"switch1": droplet("switch1"),
25+
"router1": droplet("router1"),
26+
"d1": droplet("d1"),
27+
"d2": droplet("d2"),
28+
"d3": droplet("d3")
29+
}
30+
self.c = controller(self.droplets)
31+
32+
self.c.create_vpc(3, cidr("16", "10.0.0.0"), ["router1"])
33+
self.c.create_network(3, 1, cidr("24", "10.0.0.0"), ["switch1"])
34+
self.ep0 = self.c.create_simple_endpoint(3, 1, "10.0.0.2", "switch1")
35+
self.ep1 = self.c.create_simple_endpoint(3, 1, "10.0.0.3", "d2")
36+
self.ep2 = self.c.create_simple_endpoint(3, 1, "10.0.0.4", "d3")
37+
38+
self.sep_backend = [self.ep1, self.ep2]
39+
self.sep = self.c.create_scaled_endpoint(
40+
3, 1, "10.0.0.5", self.sep_backend)
41+
42+
def tearDown(self):
43+
pass
44+
45+
def test_scaled_endpoint_bouncer_on_client_diff_conn(self):
46+
do_test_scaled_ep_diff_conn(self, self.ep0, self.sep, self.sep_backend)
47+
do_check_failed_rpcs(self, self.droplets.values())
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Copyright (c) 2019 The Authors.
2+
#
3+
# Authors: Sherif Abdelwahab <@zasherif>
4+
# Phu Tran <@phudtran>
5+
#
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
9+
# License for the specific language governing permissions and limitations
10+
# under the License.
11+
12+
from test.trn_controller.controller import controller
13+
from test.trn_controller.droplet import droplet
14+
from test.trn_controller.common import cidr
15+
from test.trn_func_tests.helper import *
16+
import unittest
17+
from time import sleep
18+
19+
20+
class test_scaled_endpoint_bouncer_on_client_many_proto(unittest.TestCase):
21+
22+
def setUp(self):
23+
24+
self.droplets = {
25+
"d0": droplet("d0"),
26+
"d1": droplet("d1"),
27+
"d2": droplet("d2"),
28+
"d3": droplet("d3"),
29+
"d4": droplet("d4"),
30+
"d5": droplet("d5"),
31+
"d6": droplet("d6")
32+
}
33+
self.c = controller(self.droplets)
34+
35+
self.c.create_vpc(3, cidr("16", "10.0.0.0"), [])
36+
self.c.create_network(3, 1, cidr("16", "10.0.0.0"), ["d0"])
37+
self.ep0 = self.c.create_simple_endpoint(3, 1, "10.0.0.2", "d0")
38+
self.ep1 = self.c.create_simple_endpoint(3, 1, "10.0.0.3", "d2")
39+
self.ep2 = self.c.create_simple_endpoint(3, 1, "10.0.0.4", "d3")
40+
self.ep3 = self.c.create_simple_endpoint(3, 1, "10.0.0.5", "d4")
41+
self.ep4 = self.c.create_simple_endpoint(3, 1, "10.0.0.6", "d5")
42+
self.ep5 = self.c.create_simple_endpoint(3, 1, "10.0.0.7", "d6")
43+
44+
self.sep_backend = [self.ep1, self.ep2, self.ep3, self.ep4, self.ep5]
45+
self.sep = self.c.create_scaled_endpoint(
46+
3, 1, "10.0.0.8", self.sep_backend)
47+
48+
def tearDown(self):
49+
pass
50+
51+
def test_scaled_endpoint_bouncer_on_client_many_proto(self):
52+
do_test_scaled_ep_basic(self, self.ep0, self.sep, self.sep_backend)
53+
do_check_failed_rpcs(self, self.droplets.values())
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (c) 2019 The Authors.
2+
#
3+
# Authors: Sherif Abdelwahab <@zasherif>
4+
# Phu Tran <@phudtran>
5+
#
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
9+
# License for the specific language governing permissions and limitations
10+
# under the License.
11+
12+
from test.trn_controller.controller import controller
13+
from test.trn_controller.droplet import droplet
14+
from test.trn_controller.common import cidr
15+
from test.trn_func_tests.helper import *
16+
import unittest
17+
from time import sleep
18+
19+
20+
class test_scaled_endpoint_bouncer_on_client_same_conn(unittest.TestCase):
21+
22+
def setUp(self):
23+
self.droplets = {
24+
"switch1": droplet("switch1"),
25+
"router1": droplet("router1"),
26+
"d1": droplet("d1"),
27+
"d2": droplet("d2"),
28+
"d3": droplet("d3")
29+
}
30+
self.c = controller(self.droplets)
31+
32+
self.c.create_vpc(3, cidr("16", "10.0.0.0"), ["router1"])
33+
self.c.create_network(3, 1, cidr("24", "10.0.0.0"), ["switch1"])
34+
self.ep0 = self.c.create_simple_endpoint(3, 1, "10.0.0.2", "switch1")
35+
self.ep1 = self.c.create_simple_endpoint(3, 1, "10.0.0.3", "d2")
36+
self.ep2 = self.c.create_simple_endpoint(3, 1, "10.0.0.4", "d3")
37+
38+
self.sep_backend = [self.ep1, self.ep2]
39+
self.sep = self.c.create_scaled_endpoint(
40+
3, 1, "10.0.0.5", self.sep_backend)
41+
42+
def tearDown(self):
43+
pass
44+
45+
def test_scaled_endpoint_bouncer_on_client_same_conn(self):
46+
do_test_scaled_ep_same_conn(self, self.ep0, self.sep, self.sep_backend)
47+
do_check_failed_rpcs(self, self.droplets.values())

0 commit comments

Comments
 (0)