Skip to content

Commit

Permalink
api/v1alpha1/proxmoxcluster_types: add port 0 test
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Wischke (65278) authored and wikkyk committed Jun 26, 2024
1 parent 23b8364 commit 7e39db9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion api/v1alpha1/proxmoxcluster_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,21 @@ var _ = Describe("ProxmoxCluster Test", func() {
})

Context("ClusterPort", func() {
It("Should not allow invalid ports", func() {
It("Should not allow ports higher than 65535", func() {
dc := defaultCluster()
dc.Spec.ControlPlaneEndpoint = &clusterv1.APIEndpoint{
Port: 65536,
}
Expect(k8sClient.Create(context.Background(), dc)).Should(MatchError(ContainSubstring("port must be within 1-65535")))
})

It("Should not allow port 0", func() {
dc := defaultCluster()
dc.Spec.ControlPlaneEndpoint = &clusterv1.APIEndpoint{
Port: 0,
}
Expect(k8sClient.Create(context.Background(), dc)).Should(MatchError(ContainSubstring("port must be within 1-65535")))
})
})

Context("IPv4Config", func() {
Expand Down

0 comments on commit 7e39db9

Please sign in to comment.