@@ -1625,7 +1625,7 @@ func TestEgressLifecycle(t *testing.T) {
1625
1625
doneDummyEvent (t , c )
1626
1626
}
1627
1627
1628
- func TestBGPSecretUpdate (t * testing.T ) {
1628
+ func TestBGPPasswordUpdate (t * testing.T ) {
1629
1629
policy := generateBGPPolicy (bgpPolicyName1 ,
1630
1630
creationTimestamp ,
1631
1631
nodeLabels1 ,
@@ -1698,12 +1698,30 @@ func TestBGPSecretUpdate(t *testing.T) {
1698
1698
1699
1699
// Wait for the dummy event triggered by Secret update event, and mark it done.
1700
1700
waitAndGetDummyEvent (t , c )
1701
- updatedIPv4Peer1Config := ipv4Peer1Config
1702
- updatedIPv4Peer3Config := ipv4Peer3Config
1703
- updatedIPv4Peer1Config .Password = "updated-" + peer1AuthPassword
1704
- updatedIPv4Peer3Config .Password = "updated-" + peer3AuthPassword
1705
- mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), updatedIPv4Peer1Config )
1706
- mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), updatedIPv4Peer3Config )
1701
+ expectedIPv4Peer1Config := ipv4Peer1Config
1702
+ expectedIPv4Peer3Config := ipv4Peer3Config
1703
+ expectedIPv4Peer1Config .Password = "updated-" + peer1AuthPassword
1704
+ expectedIPv4Peer3Config .Password = "updated-" + peer3AuthPassword
1705
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer1Config )
1706
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer3Config )
1707
+ require .NoError (t , c .syncBGPPolicy (ctx ))
1708
+ // Done with the dummy event.
1709
+ doneDummyEvent (t , c )
1710
+
1711
+ // Delete the Secret.
1712
+ err = c .client .CoreV1 ().Secrets (namespaceKubeSystem ).Delete (context .TODO (), secret .Name , metav1.DeleteOptions {})
1713
+ require .NoError (t , err )
1714
+ // Wait for the dummy event triggered by Secret delete event, and mark it done.
1715
+ waitAndGetDummyEvent (t , c )
1716
+ expectedIPv4Peer1Config = ipv4Peer1Config
1717
+ expectedIPv4Peer2Config := ipv4Peer2Config
1718
+ expectedIPv4Peer3Config = ipv4Peer3Config
1719
+ expectedIPv4Peer1Config .Password = ""
1720
+ expectedIPv4Peer2Config .Password = ""
1721
+ expectedIPv4Peer3Config .Password = ""
1722
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer1Config )
1723
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer2Config )
1724
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer3Config )
1707
1725
require .NoError (t , c .syncBGPPolicy (ctx ))
1708
1726
// Done with the dummy event.
1709
1727
doneDummyEvent (t , c )
0 commit comments