@@ -1515,7 +1515,7 @@ func TestEgressLifecycle(t *testing.T) {
1515
1515
doneDummyEvent (t , c )
1516
1516
}
1517
1517
1518
- func TestBGPSecretUpdate (t * testing.T ) {
1518
+ func TestBGPPasswordUpdate (t * testing.T ) {
1519
1519
policy := generateBGPPolicy (bgpPolicyName1 ,
1520
1520
creationTimestamp ,
1521
1521
nodeLabels1 ,
@@ -1594,12 +1594,30 @@ func TestBGPSecretUpdate(t *testing.T) {
1594
1594
1595
1595
// Wait for the dummy event triggered by Secret update event, and mark it done.
1596
1596
waitAndGetDummyEvent (t , c )
1597
- updatedIPv4Peer1Config := ipv4Peer1Config
1598
- updatedIPv4Peer3Config := ipv4Peer3Config
1599
- updatedIPv4Peer1Config .Password = "updated-" + peer1AuthPassword
1600
- updatedIPv4Peer3Config .Password = "updated-" + peer3AuthPassword
1601
- mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), updatedIPv4Peer1Config )
1602
- mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), updatedIPv4Peer3Config )
1597
+ expectedIPv4Peer1Config := ipv4Peer1Config
1598
+ expectedIPv4Peer3Config := ipv4Peer3Config
1599
+ expectedIPv4Peer1Config .Password = "updated-" + peer1AuthPassword
1600
+ expectedIPv4Peer3Config .Password = "updated-" + peer3AuthPassword
1601
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer1Config )
1602
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer3Config )
1603
+ require .NoError (t , c .syncBGPPolicy (ctx ))
1604
+ // Done with the dummy event.
1605
+ doneDummyEvent (t , c )
1606
+
1607
+ // Delete the Secret.
1608
+ err = c .client .CoreV1 ().Secrets (namespaceKubeSystem ).Delete (context .TODO (), secret .Name , metav1.DeleteOptions {})
1609
+ require .NoError (t , err )
1610
+ // Wait for the dummy event triggered by Secret delete event, and mark it done.
1611
+ waitAndGetDummyEvent (t , c )
1612
+ expectedIPv4Peer1Config = ipv4Peer1Config
1613
+ expectedIPv4Peer2Config := ipv4Peer2Config
1614
+ expectedIPv4Peer3Config = ipv4Peer3Config
1615
+ expectedIPv4Peer1Config .Password = ""
1616
+ expectedIPv4Peer2Config .Password = ""
1617
+ expectedIPv4Peer3Config .Password = ""
1618
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer1Config )
1619
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer2Config )
1620
+ mockBGPServer .EXPECT ().UpdatePeer (gomock .Any (), expectedIPv4Peer3Config )
1603
1621
require .NoError (t , c .syncBGPPolicy (ctx ))
1604
1622
// Done with the dummy event.
1605
1623
doneDummyEvent (t , c )
0 commit comments