~ubuntu-branches/ubuntu/utopic/exabgp/utopic

« back to all changes in this revision

Viewing changes to dev/apitest/operational-send.py

  • Committer: Package Import Robot
  • Author(s): Henry-Nicolas Tourneur
  • Date: 2014-03-08 19:07:00 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140308190700-xjbibpg1g6001c9x
Tags: 3.3.1-1
* New upstream release
* Bump python minimal required version (2.7)
* Closes: #726066 Debian packaging improvements proposed by Vincent Bernat
* Closes: #703774 not existent rundir (/var/run/exabgp) after reboot

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
import os
 
4
import sys
 
5
import time
 
6
 
 
7
# When the parent dies we are seeing continual newlines, so we only access so many before stopping
 
8
counter = 1
 
9
 
 
10
# sleep a little bit or we will never see the asm in the configuration file
 
11
# and the message received just before we go to the established loop will be printed twice
 
12
time.sleep(1)
 
13
 
 
14
print 'operational rpcq afi ipv4 safi unicast sequence %d' % counter
 
15
print 'operational rpcp afi ipv4 safi unicast sequence %d rxc 100 txc 200' % counter
 
16
time.sleep(1)
 
17
 
 
18
counter += 1
 
19
 
 
20
print 'operational apcq afi ipv4 safi unicast sequence %d' % counter
 
21
print 'operational apcp afi ipv4 safi unicast sequence %d counter 150' % counter
 
22
time.sleep(1)
 
23
 
 
24
counter += 1
 
25
 
 
26
print 'operational lpcq afi ipv4 safi unicast sequence %d' % counter
 
27
print 'operational lpcp afi ipv4 safi unicast sequence %d counter 250' % counter
 
28
time.sleep(1)
 
29
 
 
30
while True:
 
31
        try:
 
32
                time.sleep(1)
 
33
                if counter % 2:
 
34
                        print 'operational adm afi ipv4 safi unicast advisory "this is dynamic message #%d"' % counter
 
35
                        sys.stdout.flush()
 
36
                else:
 
37
                        print 'operational asm afi ipv4 safi unicast advisory "we SHOULD not send asm from the API"'
 
38
                        sys.stdout.flush()
 
39
 
 
40
                counter += 1
 
41
        except KeyboardInterrupt:
 
42
                pass
 
43
        except IOError:
 
44
                break