Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp / test / run_tests.py @ master

History | View | Annotate | Download (2.44 KB)

1
#!/usr/bin/env python
2

    
3
# ----- BEGIN LICENSE BLOCK -----
4
#        GDP: Global Data Plane
5
#        From the Ubiquitous Swarm Lab, 490 Cory Hall, U.C. Berkeley.
6
#
7
#        Copyright (c) 2016, Regents of the University of California.
8
#        All rights reserved.
9
#
10
#        Permission is hereby granted, without written agreement and without
11
#        license or royalty fees, to use, copy, modify, and distribute this
12
#        software and its documentation for any purpose, provided that the above
13
#        copyright notice and the following two paragraphs appear in all copies
14
#        of this software.
15
#
16
#        IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
17
#        SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST
18
#        PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
19
#        EVEN IF REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20
#
21
#        REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
22
#        LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23
#        FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION,
24
#        IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO
25
#        OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
26
#        OR MODIFICATIONS.
27
# ----- END LICENSE BLOCK -----
28

    
29
"""
30
Invoke the executables in this directory using Python 
31
so that we can get the output in JUnit compatible xml.
32

33
See README.txt for details.
34
"""
35

    
36
import socket
37
import subprocess
38

    
39
# Parsing the logName command line argument is set up in conftest.py.
40

    
41
def test_t_fwd_append(logName):
42
    subprocess.check_call(["./t_fwd_append", "-D *=18", logName, socket.gethostname()])
43

    
44
# Create the x00 log for use in other tests.  If the log already
45
# exists, then gcl-create returns 1, which can be ignored.
46
def test_gcl_create():
47
    try:
48
        subprocess.check_call(["../apps/gcl-create", "-k", "none", "-s", socket.gethostname(), "x00"]);
49
    except  subprocess.CalledProcessError as e:
50
        returncode = e.returncode
51
        if returncode != 73:
52
            print returncode
53
            raise
54

    
55
# Uses logName, which has some data.
56
# FIXME: t_multmultiread fails if the log is empty.
57
def test_t_multimultiread(logName):
58
    subprocess.check_call(["./t_multimultiread", "-D gdp.proto=37", logName])
59

    
60
# Uses the x00 log, which is new at this point.
61
#def test_t_multimultiread_x00(logName):
62
#    subprocess.check_call(["./t_multimultiread", "-D gdp.proto=37", "x00"])
63

    
64
# Uses the x00 log.
65
def test_t_sub_and_append(logName):
66
    subprocess.check_call(["./t_sub_and_append"])
67