@@ -31,46 +31,46 @@ def test_normal_operations(self):
3131time .sleep (3 )
3232aggs = self .client .get_status ()
3333MtmClient .print_aggregates (aggs )
34- # for agg in aggs:
35- # # there were some commits
36- # self.assertTrue( agg['transfer '] > 0 )
37-
38- # def test_node_partition(self):
39- # print('### nodePartitionTest ###')
40-
41- # subprocess.check_call(['blockade','partition','node3'])
42- # print('### blockade node3 ###')
43-
44- # # clear tx history
45- # self.client.get_status()
46-
47- # for i in range(3):
48- # print(i, datetime.datetime.now())
49- # time.sleep(3)
50- # aggs = self.client.get_status()
51- # MtmClient.print_aggregates(aggs)
52- # # self.assertTrue( aggs['transfer_0']['finish']['commit'] > 0 )
53- # # self.assertTrue( aggs['transfer_1']['finish']['commit'] > 0 )
54- # # self.assertTrue( aggs['transfer_2']['finish']['commit'] == 0 )
55- # self.assertTrue( aggs['sumtotal_0']['isolation'] + aggs['sumtotal_1']['isolation'] + aggs['sumtotal_2']['isolation'] == 0 )
56-
57- # subprocess.check_call(['blockade','join'])
58- # print('### deblockade node3 ###')
59-
60- # # clear tx history
61- # self.client.get_status()
62-
63- # for i in range(20):
64- # print(i, datetime.datetime.now())
65- # time.sleep(3)
66- # aggs = self.client.get_status()
67- # MtmClient.print_aggregates(aggs)
68- # self.assertTrue( aggs['sumtotal_0']['isolation'] + aggs['sumtotal_1']['isolation'] + aggs['sumtotal_2']['isolation'] == 0 )
69-
70- # # check that during last aggregation all nodes were working
71- # self.assertTrue( aggs['transfer_0']['finish']['commit'] > 0 )
72- # self.assertTrue( aggs['transfer_1']['finish']['commit'] > 0 )
73- # self.assertTrue( aggs['transfer_2']['finish']['commit'] > 0 )
34+ print ( aggs )
35+ for agg in aggs :
36+ self .assertTrue (aggs [ agg ][ 'finish' ][ 'commit ' ]> 0 )
37+
38+ def test_node_partition (self ):
39+ print ('### nodePartitionTest ###' )
40+
41+ subprocess .check_call (['blockade' ,'partition' ,'node3' ])
42+ print ('### blockade node3 ###' )
43+
44+ # clear tx history
45+ self .client .get_status ()
46+
47+ for i in range (3 ):
48+ print (i ,datetime .datetime .now ())
49+ time .sleep (3 )
50+ aggs = self .client .get_status ()
51+ MtmClient .print_aggregates (aggs )
52+ # self.assertTrue( aggs['transfer_0']['finish']['commit'] > 0 )
53+ # self.assertTrue( aggs['transfer_1']['finish']['commit'] > 0 )
54+ # self.assertTrue( aggs['transfer_2']['finish']['commit'] == 0 )
55+ self .assertTrue (aggs ['sumtotal_0' ]['isolation' ]+ aggs ['sumtotal_1' ]['isolation' ]+ aggs ['sumtotal_2' ]['isolation' ]== 0 )
56+
57+ subprocess .check_call (['blockade' ,'join' ])
58+ print ('### deblockade node3 ###' )
59+
60+ # clear tx history
61+ self .client .get_status ()
62+
63+ for i in range (20 ):
64+ print (i ,datetime .datetime .now ())
65+ time .sleep (3 )
66+ aggs = self .client .get_status ()
67+ MtmClient .print_aggregates (aggs )
68+ self .assertTrue (aggs ['sumtotal_0' ]['isolation' ]+ aggs ['sumtotal_1' ]['isolation' ]+ aggs ['sumtotal_2' ]['isolation' ]== 0 )
69+
70+ # check that during last aggregation all nodes were working
71+ self .assertTrue (aggs ['transfer_0' ]['finish' ]['commit' ]> 0 )
72+ self .assertTrue (aggs ['transfer_1' ]['finish' ]['commit' ]> 0 )
73+ self .assertTrue (aggs ['transfer_2' ]['finish' ]['commit' ]> 0 )
7474
7575
7676