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