@@ -1602,7 +1602,7 @@ func TestEgressLifecycle(t *testing.T) {
1602
1602
doneDummyEvent (t , c )
1603
1603
}
1604
1604
1605
- func TestBGPSecretUpdate (t * testing.T ) {
1605
+ func TestBGPPasswordUpdate (t * testing.T ) {
1606
1606
policy := generateBGPPolicy (bgpPolicyName1 ,
1607
1607
creationTimestamp ,
1608
1608
nodeLabels1 ,
@@ -1681,12 +1681,30 @@ func TestBGPSecretUpdate(t *testing.T) {
1681
1681
1682
1682
// Wait for the dummy event triggered by Secret update event, and mark it done.
1683
1683
waitAndGetDummyEvent (t , c )
1684
- updatedIPv4Peer1Config := ipv4Peer1Config
1685
- updatedIPv4Peer3Config := ipv4Peer3Config
1686
- updatedIPv4Peer1Config .Password = "updated-" + peer1AuthPassword
1687
- updatedIPv4Peer3Config .Password = "updated-" + peer3AuthPassword
1688
- mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), updatedIPv4Peer1Config )
1689
- mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), updatedIPv4Peer3Config )
1684
+ expectedIPv4Peer1Config := ipv4Peer1Config
1685
+ expectedIPv4Peer3Config := ipv4Peer3Config
1686
+ expectedIPv4Peer1Config .Password = "updated-" + peer1AuthPassword
1687
+ expectedIPv4Peer3Config .Password = "updated-" + peer3AuthPassword
1688
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer1Config )
1689
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer3Config )
1690
+ require .NoError (t , c .syncBGPPolicy (ctx ))
1691
+ // Done with the dummy event.
1692
+ doneDummyEvent (t , c )
1693
+
1694
+ // Delete the Secret.
1695
+ err = c .client .CoreV1 ().Secrets (namespaceKubeSystem ).Delete (context .TODO (), secret .Name , metav1.DeleteOptions {})
1696
+ require .NoError (t , err )
1697
+ // Wait for the dummy event triggered by Secret delete event, and mark it done.
1698
+ waitAndGetDummyEvent (t , c )
1699
+ expectedIPv4Peer1Config = ipv4Peer1Config
1700
+ expectedIPv4Peer2Config := ipv4Peer2Config
1701
+ expectedIPv4Peer3Config = ipv4Peer3Config
1702
+ expectedIPv4Peer1Config .Password = ""
1703
+ expectedIPv4Peer2Config .Password = ""
1704
+ expectedIPv4Peer3Config .Password = ""
1705
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer1Config )
1706
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer2Config )
1707
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer3Config )
1690
1708
require .NoError (t , c .syncBGPPolicy (ctx ))
1691
1709
// Done with the dummy event.
1692
1710
doneDummyEvent (t , c )
0 commit comments