~rdiaz02/functional-testing/main01

« back to all changes in this revision

Viewing changes to PomeloII/testPomelo.py

  • Committer: ramon diaz-uriarte
  • Date: 2010-06-28 10:38:01 UTC
  • Revision ID: ramon@xantusia-20100628103801-zuylp1s80l3w0jq4
(trying to) prevent false error reports

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
def common_part(self, final_output,                
18
18
                MAX_running_time = 3600,
19
19
                auto_refresh_string = auto_refresh_string):    
 
20
    print '\n Start common_part \n'
20
21
    server_url = self.server_url
21
22
    start_run = time.time()
22
23
    refresh_num = 0
23
 
    time.sleep(15)
 
24
    time.sleep(3)
 
25
    print '\n At 00 \n'
24
26
    while True:
25
 
        print '\nGot to 0\n'
26
 
        final_body = self.getBody()
 
27
        try:
 
28
            print '\n At 01 \n'
 
29
            final_body = self.getBody()
 
30
        except:
 
31
            time.sleep(5)
 
32
            print '\n At 01-except \n'
 
33
            final_body = self.getBody()
27
34
        print '\nGot to 1\n'
28
35
        if final_body.find(auto_refresh_string) < 0:
29
36
            print '\nGot to break\n'
30
37
            break
31
 
        time.sleep(45)
 
38
        time.sleep(13)
32
39
        refresh_num += 1
33
40
        run_time = time.time() - start_run
34
41
        print '\nGot to 2\n'
36
43
              + str(round(run_time/60.0, 2)) + ' minutes.\n'
37
44
        if run_time > MAX_running_time :
38
45
            self.fail('Run longer than MAX_running_time')
39
 
        self.get(server_url + self.getLastUrl(),
40
 
                 description="Get /cgi-bin/checkdone.cgi")
41
 
        print '\nGot to 3\n'
42
 
        time.sleep(15)
43
 
        print '\nGot to 4\n'
44
 
    ## print final_body
 
46
 
 
47
        checkdoneUrl = server_url + self.getLastUrl()
 
48
        print '\n checkdoneUrl = '
 
49
        print checkdoneUrl
 
50
 
 
51
        try:
 
52
            print '\n At 03 \n'
 
53
            gg = self.get(checkdoneUrl,
 
54
                          description="Get /cgi-bin/checkdone.cgi")
 
55
            print '\n This is gg \n'
 
56
            print str(gg)
 
57
        except:
 
58
            time.sleep(5)
 
59
            print '\n At 03 - except \n'
 
60
            gg = self.get(checkdoneUrl,
 
61
                          description="Get /cgi-bin/checkdone.cgi")
 
62
            print '\n This is gg \n'
 
63
            print str(gg)
45
64
    expected = final_body.find(final_output) >= 0
46
 
    print '\nGot to 5\n'
47
65
    if not expected:
48
66
        self.fail('\n ***** (begin of) Unexpected final result!!!! *****\n' + \
49
67
                 str(final_body) + \
52
70
        print 'OK'
53
71
 
54
72
 
 
73
    #     self.get(server_url + self.getLastUrl(),
 
74
    #              description="Get /cgi-bin/checkdone.cgi")
 
75
    #     print '\nGot to 3\n'
 
76
    #     time.sleep(15)
 
77
    #     print '\nGot to 4\n'
 
78
    # ## print final_body
 
79
    # expected = final_body.find(final_output) >= 0
 
80
    # print '\nGot to 5\n'
 
81
    # if not expected:
 
82
    #     self.fail('\n ***** (begin of) Unexpected final result!!!! *****\n' + \
 
83
    #              str(final_body) + \
 
84
    #              '\n ***** (end of) Unexpected final result!!!! *****\n')
 
85
    # else:
 
86
    #     print 'OK'
 
87
 
 
88
 
55
89
def common_weird(self):
56
90
    ''' For weird names, we do something special, otherwise it takes
57
91
    forever.  We do not wait for it to really finish and return results,