Add BGPPeer password test
@@ -1042,6 +1042,25 @@ class TestCalicoctlCommands(TestBase):
rc.assert_output_contains("has(rr)")
assert "global" not in rc.output
+ def test_bgppeer_password(self):
+ rc = calicoctl("create", data={
+ 'apiVersion': API_VERSION,
+ 'kind': 'BGPPeer',
+ 'metadata': {
+ 'name': 'bp1'
+ },
+ 'spec': {
+ 'password': {'secretKeyRef': {'name': 'bgp-passwords', 'key': 'bp1p'}},
+ 'peerSelector': "has(rr)",
+ },
+ })
+ rc.assert_no_error()
+
+ rc = calicoctl("get bgpp")
+ rc.assert_no_error()
+ rc.assert_output_contains("bp1")
+ rc.assert_output_contains("global")
+
def test_label_command(self):
"""
Test calicoctl label command.
