Skip to content

Commit 42f9383

Browse files
[SNAT/DNAT]: add description/tests (#899)
1 parent f15cca8 commit 42f9383

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

acceptance/openstack/ces/v1/alarms_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
)
1111

1212
func TestAlarms(t *testing.T) {
13+
t.Skip("API is faulty - returning 400 error.")
1314
client, err := clients.NewCesV1Client()
1415
th.AssertNoErr(t, err)
1516

acceptance/openstack/networking/v2/extensions/dnatrulest_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func TestDnatRuleLifeCycle(t *testing.T) {
3737
FloatingIpID: elasticIp.ID,
3838
ExternalServicePort: &allServicePorts,
3939
Protocol: "any",
40+
Description: "test description",
4041
}
4142
dnatRule, err := dnatrules.Create(client, createDCOpts)
4243
th.AssertNoErr(t, err)
@@ -107,6 +108,7 @@ func TestDnatRuleLifeCycle(t *testing.T) {
107108
newDnatRule, err := dnatrules.Get(client, dnatRule.ID)
108109
th.AssertNoErr(t, err)
109110
th.AssertEquals(t, createDCOpts.NatGatewayID, newDnatRule.NatGatewayId)
111+
th.AssertEquals(t, createDCOpts.Description, newDnatRule.Description)
110112

111113
t.Logf("Attempting to list DNAT rules")
112114
listRules, err := dnatrules.List(client, dnatrules.ListOpts{})

acceptance/openstack/networking/v2/extensions/snatrules_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func TestSnatRuleLifeCycle(t *testing.T) {
2424
NetworkID: natGateway.InternalNetworkID,
2525
FloatingIPID: elasticIp.ID,
2626
SourceType: 0,
27+
Description: "Test description",
2728
}
2829
snatRule, err := snatrules.Create(client, createOpts)
2930
th.AssertNoErr(t, err)
@@ -40,6 +41,7 @@ func TestSnatRuleLifeCycle(t *testing.T) {
4041
newSnatRule, err := snatrules.Get(client, snatRule.ID)
4142
th.AssertNoErr(t, err)
4243
th.AssertEquals(t, createOpts.NatGatewayID, newSnatRule.NatGatewayID)
44+
th.AssertEquals(t, createOpts.Description, newSnatRule.Description)
4345

4446
t.Logf("Attempting to Obtain SNAT rules in NAT Gateway: %s", natGateway.ID)
4547
listnatRules, err := snatrules.List(client, snatrules.ListOpts{

openstack/networking/v2/extensions/snatrules/Create.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,6 @@ type SnatRule struct {
7979
// Its value rounds to 6 decimal places for seconds.
8080
// The format is yyyy-mm-dd hh:mm:ss.
8181
CreatedAt string `json:"created_at"`
82+
// Provides supplementary information about the SNAT rule.
83+
Description string `json:"description"`
8284
}

0 commit comments

Comments
 (0)