Skip to content

Commit

Permalink
reduce sleep on test
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mangin committed Sep 25, 2024
1 parent 82b21cd commit 2d8f291
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 48 deletions.
5 changes: 4 additions & 1 deletion etc/exabgp/run/api-add-remove.run
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ import time
messages = [
'announce route 1.1.0.0/24 next-hop 101.1.101.1',
'announce route 1.1.0.0/25 next-hop 101.1.101.1',
'sleep',
'withdraw route 1.1.0.0/24',
'withdraw route 1.1.0.0/25 next-hop 0.0.0.0',
]

while messages:
message = messages.pop(0)
if message == 'sleep':
time.sleep(0.2)
continue
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(0.3)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-announcement.run
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ messages = [
'neighbor 127.0.0.1 local-as 2 peer-as 3 local-ip 127.0.0.1 router-id 1.2.3.4 announce route 1.8.0.0/21 next-hop 101.1.101.1 med 200 large-community [2914:1:0]',
]

time.sleep(0.5)
time.sleep(0.2)

while messages:
message = messages.pop(0)
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-attributes-path.run
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-attributes-vpn.run
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-attributes.run
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-check.run
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ try:
):
sys.stdout.write('neighbor 127.0.0.1 announce route 0.0.0.0/0 next-hop 255.255.255.255\n')
sys.stdout.flush()
time.sleep(5)
time.sleep(1)
sys.exit(1)
break

Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-eor.run
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(1)
time.sleep(0.2)

try:
now = time.time()
Expand Down
6 changes: 3 additions & 3 deletions etc/exabgp/run/api-fast.run
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ messages3 = [
'announce route 0.0.0.0/0 next-hop 1.101.1.101',
]

time.sleep(2)
time.sleep(0.2)

sys.stdout.write('\n'.join(messages1) + '\n')
sys.stdout.flush()

time.sleep(1)
time.sleep(0.2)

sys.stdout.write('\n'.join(messages2) + '\n')
sys.stdout.flush()

time.sleep(1)
time.sleep(0.2)

while messages3:
message = messages3.pop(0)
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-flow.run
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ withdraw_flow_1 = (
)
announce_flow_2 = 'announce flow route { match { source 255.255.255.255/32; destination 255.255.255.255/32; } then { rate-limit 65535; } }'

time.sleep(2) # let the EOR pass
time.sleep(0.2) # let the EOR pass

messages = [
withdraw_flow_1,
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-ipv4.run
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(1)
time.sleep(0.2)

try:
now = time.time()
Expand Down
4 changes: 2 additions & 2 deletions etc/exabgp/run/api-ipv6.run
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ messages = [
withdraw_mup,
]

time.sleep(3)
time.sleep(0.2)

while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(1)
time.sleep(0.2)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-multi-neighbor.run
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-multiple-private.run
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(5)
time.sleep(1)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-multiple-public.run
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(2)
time.sleep(0.2)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-multisession.run
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

try:
now = time.time()
Expand Down
4 changes: 2 additions & 2 deletions etc/exabgp/run/api-mvpn.run
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ routes = [
for r in routes:
sys.stdout.write('announce ' + r + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.1)

time.sleep(5)

for r in routes:
sys.stdout.write('withdraw ' + r + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.1)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-nexthop-self.run
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

try:
now = time.time()
Expand Down
4 changes: 2 additions & 2 deletions etc/exabgp/run/api-nexthop.run
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import time

sys.stdout.write('neighbor 127.0.0.1 announce route 2605::2/128 next-hop 2001::1 local-preference 500\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

sys.stdout.write('neighbor 127.0.0.1 announce route 2605::2/128 next-hop 2001::2 local-preference 500\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

sys.stdout.write('neighbor 127.0.0.1 announce route 2605::2/128 next-hop 2001::1 local-preference 500\n')
sys.stdout.flush()
Expand Down
4 changes: 2 additions & 2 deletions etc/exabgp/run/api-no-respawn-2.run
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ messages = [
'announce route 3.3.3.3/32 next-hop 33.33.33.33',
]

time.sleep(2.0)
time.sleep(0.2)
while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(1.0)
time.sleep(0.2)

try:
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-notification.run
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sys
import time

try:
time.sleep(1)
time.sleep(0.2)
# this will never be received by the peer
sys.stdout.write('announce route 1.2.3.4 next-hop 5.6.7.8\n')
now = time.time()
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-open.run
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ try:
sys.stdout.write('announce route 1.1.1.1/32 next-hop 101.1.101.1 med 200\n')
sys.stdout.flush()

time.sleep(1)
time.sleep(0.2)

line = sys.stdin.readline().strip()
if not line or line in ['done', 'shutdown']:
Expand Down
2 changes: 1 addition & 1 deletion etc/exabgp/run/api-reload.run
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

try:
now = time.time()
Expand Down
14 changes: 7 additions & 7 deletions etc/exabgp/run/api-rib.run
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ try:
sys.stdout.write('announce route 192.168.0.0/32 next-hop 10.0.0.0\n')
sys.stdout.write('clear adj-rib out\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)

sys.stdout.write('announce route 192.168.0.1/32 next-hop 10.0.0.1\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)
sys.stdout.write('clear adj-rib out\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)

sys.stdout.write('announce route 192.168.0.2/32 next-hop 10.0.0.2\n')
sys.stdout.write('announce route 192.168.0.3/32 next-hop 10.0.0.3\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)
sys.stdout.write('flush adj-rib out\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)

sys.stdout.write('announce route 192.168.0.4/32 next-hop 10.0.0.4\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)
sys.stdout.write('flush adj-rib out\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)

sys.stdout.write('clear adj-rib out\n')
sys.stdout.flush()
Expand Down
14 changes: 7 additions & 7 deletions etc/exabgp/run/api-rr-rib.run
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ try:
sys.stdout.write('announce route 192.168.0.0/32 next-hop 10.0.0.0\n')
sys.stdout.write('clear adj-rib out\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)

sys.stdout.write('announce route 192.168.0.1/32 next-hop 10.0.0.1\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)
sys.stdout.write('clear adj-rib out\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)

sys.stdout.write('announce route 192.168.0.2/32 next-hop 10.0.0.2\n')
sys.stdout.write('announce route 192.168.0.3/32 next-hop 10.0.0.3\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)
sys.stdout.write('flush adj-rib out\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)

sys.stdout.write('announce route 192.168.0.4/32 next-hop 10.0.0.4\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)
sys.stdout.write('flush adj-rib out\n')
sys.stdout.flush()
time.sleep(0.5)
time.sleep(0.2)

sys.stdout.write('clear adj-rib out\n')
sys.stdout.flush()
Expand Down
4 changes: 2 additions & 2 deletions etc/exabgp/run/api-vpls.run
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ messages = [
'neighbor 127.0.0.1 withdraw vpls endpoint 5 base 10702 offset 1 size 8 rd 192.168.201.1:123 next-hop 192.168.201.1',
]

time.sleep(2) # wait for the EOR
time.sleep(0.2) # wait for the EOR

while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(0.3)
time.sleep(0.2)

try:
now = time.time()
Expand Down
4 changes: 2 additions & 2 deletions etc/exabgp/run/api-vpnv4.run
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ messages = [
# 'withdraw route 1.4.0.0/16 rd 65000:1 next-hop 101.1.101.1 community 100:1 extended-community 0x0002FDE900000001 label 1000',
]

time.sleep(1) # let the EOR pass
time.sleep(0.2) # let the EOR pass

while messages:
message = messages.pop(0)
sys.stdout.write(message + '\n')
sys.stdout.flush()
time.sleep(1)
time.sleep(0.2)

try:
now = time.time()
Expand Down
4 changes: 2 additions & 2 deletions etc/exabgp/run/watchdog.run
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ time.sleep(1) # time for configuration routes to pass
while os.getppid() != 1:
sys.stdout.write("announce watchdog dnsr\n")
sys.stdout.flush()
time.sleep(1)
time.sleep(0.2)

sys.stdout.write("withdraw watchdog dnsr\n")
sys.stdout.flush()
time.sleep(1)
time.sleep(0.2)

0 comments on commit 2d8f291

Please sign in to comment.