Skip to content

Commit a574a3e

Browse files
committed
tests: Fix TestVLANTransparentCRUD test
The 'vlan-transparent' extension is now enabled by default [1]. This is highlighting a bug in the aforementioned test: namely, that we are trying to update an attribute which is read-only [2]. Remove the update step of the job and fix the test. [1] openstack/neutron@11ff4f2 [2] https://github.com/openstack/neutron-lib/blob/fd011c955dfae1072555c69b6ba742b85f041736/neutron_lib/api/definitions/vlantransparent.py#L49 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
1 parent b6be984 commit a574a3e

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

internal/acceptance/openstack/networking/v2/extensions/vlantransparent/vlantransparent.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -75,33 +75,3 @@ func CreateVLANTransparentNetwork(t *testing.T, client *gophercloud.ServiceClien
7575

7676
return &network, nil
7777
}
78-
79-
// UpdateVLANTransparentNetwork will update a network with the
80-
// "vlan-transparent" extension. An error will be returned if the network could
81-
// not be updated.
82-
func UpdateVLANTransparentNetwork(t *testing.T, client *gophercloud.ServiceClient, networkID string) (*VLANTransparentNetwork, error) {
83-
networkName := tools.RandomString("TESTACC-NEW-", 6)
84-
networkUpdateOpts := networks.UpdateOpts{
85-
Name: &networkName,
86-
}
87-
88-
iFalse := false
89-
updateOpts := vlantransparent.UpdateOptsExt{
90-
UpdateOptsBuilder: &networkUpdateOpts,
91-
VLANTransparent: &iFalse,
92-
}
93-
94-
t.Logf("Attempting to update a VLAN-transparent network: %s", networkID)
95-
96-
var network VLANTransparentNetwork
97-
err := networks.Update(context.TODO(), client, networkID, updateOpts).ExtractInto(&network)
98-
if err != nil {
99-
return nil, err
100-
}
101-
102-
t.Logf("Successfully updated the network.")
103-
104-
th.AssertEquals(t, networkName, network.Name)
105-
106-
return &network, nil
107-
}

internal/acceptance/openstack/networking/v2/extensions/vlantransparent/vlantransparent_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ func TestVLANTransparentCRUD(t *testing.T) {
2525

2626
tools.PrintResource(t, network)
2727

28-
// Update the created VLAN transparent network.
29-
newNetwork, err := UpdateVLANTransparentNetwork(t, client, network.ID)
30-
th.AssertNoErr(t, err)
31-
32-
tools.PrintResource(t, newNetwork)
28+
// The vlan_transparent field is read-only so no update test
3329

3430
// Check that the created VLAN transparent network exists.
3531
vlanTransparentNetworks, err := ListVLANTransparentNetworks(t, client)

0 commit comments

Comments
 (0)