| #!/usr/bin/env bash |
| |
| source include.sh |
| |
| HOST_B=$IP4_B1 |
| HOST_C=$IP4_C1 |
| |
| set_up |
| |
| echo "Registering routes..." |
| |
| P_TO_B_FACE=$(register "/P" 10 $HOST_B) |
| P_TO_C_FACE=$(register "/P" 20 $HOST_C) |
| Q_TO_B_FACE=$(register "/Q" 20 $HOST_B) |
| R_TO_C_FACE=$(register "/R" 10 $HOST_C) |
| S_TO_B_FACE=$(register "/S" 3600 $HOST_B) |
| |
| sleep_for_seconds 5 |
| |
| is_expiration_period_correct "/P" $P_TO_B_FACE 3 8 |
| is_expiration_period_correct "/P" $P_TO_C_FACE 13 18 |
| is_expiration_period_correct "/Q" $Q_TO_B_FACE 13 18 |
| is_expiration_period_correct "/R" $R_TO_C_FACE 3 8 |
| is_expiration_period_correct "/S" $S_TO_B_FACE 3000 3600 |
| |
| sleep_for_seconds 10 |
| |
| is_expiration_period_correct "/P" $P_TO_C_FACE 3 8 |
| expect_route_does_not_exist "/P" $P_TO_B_FACE |
| is_expiration_period_correct "/Q" $Q_TO_B_FACE 3 8 |
| expect_entry_does_not_exist "/R" |
| is_expiration_period_correct "/S" $S_TO_B_FACE 3000 3600 |
| |
| sleep_for_seconds 8 |
| |
| expect_entry_does_not_exist "/P" |
| expect_entry_does_not_exist "/Q" |
| expect_entry_does_not_exist "/R" |
| is_expiration_period_correct "/S" $S_TO_B_FACE 3000 3600 |
| |
| clean_up |