Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp / test / run_tests.py @ master

History | View | Annotate | Download (2.44 KB)

1 6859f675 Christopher Brooks
#!/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 ae35cf73 Christopher Brooks
See README.txt for details.
34 6859f675 Christopher Brooks
"""
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 c6934049 Christopher Brooks
    subprocess.check_call(["./t_fwd_append", "-D *=18", logName, socket.gethostname()])
43 6859f675 Christopher Brooks
44 c6934049 Christopher Brooks
# Create the x00 log for use in other tests.  If the log already
45 a9a7564a Christopher Brooks
# exists, then gcl-create returns 1, which can be ignored.
46 c6934049 Christopher Brooks
def test_gcl_create():
47
    try:
48
        subprocess.check_call(["../apps/gcl-create", "-k", "none", "-s", socket.gethostname(), "x00"]);
49 a9a7564a Christopher Brooks
    except  subprocess.CalledProcessError as e:
50
        returncode = e.returncode
51 eb6ca612 Christopher Brooks
        if returncode != 73:
52 a9a7564a Christopher Brooks
            print returncode
53 c6934049 Christopher Brooks
            raise
54
55 aa4895da Christopher Brooks
# Uses logName, which has some data.
56 71659b98 Christopher Brooks
# FIXME: t_multmultiread fails if the log is empty.
57 6859f675 Christopher Brooks
def test_t_multimultiread(logName):
58 aa4895da Christopher Brooks
    subprocess.check_call(["./t_multimultiread", "-D gdp.proto=37", logName])
59
60
# Uses the x00 log, which is new at this point.
61 71659b98 Christopher Brooks
#def test_t_multimultiread_x00(logName):
62
#    subprocess.check_call(["./t_multimultiread", "-D gdp.proto=37", "x00"])
63 c6934049 Christopher Brooks
64
# Uses the x00 log.
65
def test_t_sub_and_append(logName):
66
    subprocess.check_call(["./t_sub_and_append"])
67