blob: 42361a55ca61ebcd77eb6e7e70c59ae5d8811938 [file] [log] [blame]
Vince Lehman797207e2014-07-28 16:30:51 -05001#!/usr/bin/env bash
2
3source include.sh
4
5HOST_B=$IP4_B1
6HOST_C=$IP4_C1
7
8set_up
9
10echo "Registering routes..."
11
12P_TO_B_FACE=$(register "/P" 10 $HOST_B)
13P_TO_C_FACE=$(register "/P" 20 $HOST_C)
14Q_TO_B_FACE=$(register "/Q" 20 $HOST_B)
15R_TO_C_FACE=$(register "/R" 10 $HOST_C)
16S_TO_B_FACE=$(register "/S" 3600 $HOST_B)
17
18sleep_for_seconds 5
19
20is_expiration_period_correct "/P" $P_TO_B_FACE 3 8
21is_expiration_period_correct "/P" $P_TO_C_FACE 13 18
22is_expiration_period_correct "/Q" $Q_TO_B_FACE 13 18
23is_expiration_period_correct "/R" $R_TO_C_FACE 3 8
24is_expiration_period_correct "/S" $S_TO_B_FACE 3000 3600
25
26sleep_for_seconds 10
27
28is_expiration_period_correct "/P" $P_TO_C_FACE 3 8
29expect_route_does_not_exist "/P" $P_TO_B_FACE
30is_expiration_period_correct "/Q" $Q_TO_B_FACE 3 8
31expect_entry_does_not_exist "/R"
32is_expiration_period_correct "/S" $S_TO_B_FACE 3000 3600
33
34sleep_for_seconds 8
35
36expect_entry_does_not_exist "/P"
37expect_entry_does_not_exist "/Q"
38expect_entry_does_not_exist "/R"
39is_expiration_period_correct "/S" $S_TO_B_FACE 3000 3600
40
41clean_up