~ubuntu-branches/ubuntu/jaunty/xorp/jaunty

« back to all changes in this revision

Viewing changes to tests/test_start.py

  • Committer: Bazaar Package Importer
  • Author(s): Jose Calhariz, Javier Fernandez-Sanguino, Jose Calhariz
  • Date: 2008-01-23 01:24:37 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080123012437-7l2u9r0k8e7op8st
Tags: 1.5~cvs.20080128-1
[ Javier Fernandez-Sanguino ]
* Update to latest CVS contents
* Modify debian/rules to prevent autobuilders from building 
  the binary-independent components: (Closes: #441121)
  - Create a new Build-Depends-Indep with all the TeX
  components used to build documentation
  - Since autobuilders call build, which in turns calls build-indep, hack
    the debian rules file so that the documentation is only built if ps2pdf,
    dvips and pslatex are available. 
* Modify the init.d script:
  - restart action: Do not attempt to stop xorp if not running
  - stop function: fix errors in the script
  - add a try-restart action
  - restructure the init.d script, move the restart code to a function
  - review the use of echo calls and exit values
* Use, as examples, the new boot files at rtrmgr/config/

[ Jose Calhariz ]
* Add depends on ncurses-dev, I don't know why xorp use tigetstr
  function from curses.  This way the depends field change less between
  build environments.
* Removed pushd and popd commands from Makefile and replaced with cd
  commands, was a bashism and FTBFS (closes: #453637)
* debian/control converted to utf-8 (closes: #454026) (closes: #453485)
* init.d/xorp now returns 0 if disabled.
* Added Vcs-Browser and Vcs-Svn fields pointing to the repository of the
  package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
 
3
 
# Copyright (c) 2001-2007 International Computer Science Institute
 
3
# Copyright (c) 2001-2008 International Computer Science Institute
4
4
#
5
5
# Permission is hereby granted, free of charge, to any person obtaining a
6
6
# copy of this software and associated documentation files (the "Software")
12
12
# notice is a summary of the XORP LICENSE file; the license in that file is
13
13
# legally binding.
14
14
 
15
 
# $XORP: xorp/tests/test_start.py,v 1.4 2007/07/06 00:02:44 atanu Exp $
 
15
# $XORP: xorp/tests/test_start.py,v 1.6 2008/01/04 03:17:50 pavlin Exp $
16
16
 
17
 
import threading,time,sys
 
17
import getopt,threading,time,sys
18
18
from test_process import Process
19
19
from test_builddir import builddir
20
20
 
23
23
    Start the router manager and the test harness processes.
24
24
    """
25
25
 
26
 
    def __init__(self, builddir=".."):
 
26
    def __init__(self, builddir="..", verbose = False):
27
27
        self.builddir = builddir
28
28
        self.plist = []
 
29
        self.verbose = verbose
29
30
        
30
31
    def start(self):
31
32
        """
40
41
        coord = self.builddir + "bgp/harness/coord"
41
42
        self.__start_process(coord)
42
43
 
43
 
        peer = self.builddir + "bgp/harness/test_peer -t -v"
 
44
        if self.verbose:
 
45
            peer = self.builddir + "bgp/harness/test_peer -t -v"
 
46
        else:
 
47
            peer = self.builddir + "bgp/harness/test_peer"
44
48
        for i in ["peer1", "peer2", "peer3"]:
45
49
            self.__start_process(peer + " -s " + i)
46
50
 
83
87
            i.terminate()
84
88
        
85
89
if __name__ == '__main__':
86
 
    s = Start(builddir=builddir())
 
90
    def usage():
 
91
        us = "usage: %s [-h|--help] [-v|--verbose]"
 
92
        print us % sys.argv[0]
 
93
 
 
94
    try:
 
95
        opts, args = getopt.getopt(sys.argv[1:], "hv", \
 
96
                                   ["help", \
 
97
                                    "verbose", \
 
98
                                    ])
 
99
    except getopt.GetoptError:
 
100
        usage()
 
101
        sys.exit(-1)
 
102
 
 
103
    verbose = False
 
104
    
 
105
    for o, a in opts:
 
106
        if o in ("-h", "--help"):
 
107
            usage()
 
108
            sys.exit()
 
109
        if o in ("-v", "--verbose"):
 
110
            verbose = True
 
111
    
 
112
    s = Start(builddir=builddir(), verbose=verbose)
87
113
    s.start()
88
114
    if not s.check():
89
115
        print "Processes did not start"