@@ -42,7 +42,7 @@ func TestList(t *testing.T) {
42
42
43
43
expected := []ports.Port {
44
44
{
45
- Status : "ACTIVE" ,
45
+ Status : ports . PortStatusActive ,
46
46
Name : "" ,
47
47
AdminStateUp : true ,
48
48
NetworkID : "70c1db1f-b701-45bd-96e0-a313ee3430b3" ,
@@ -102,7 +102,7 @@ func TestListWithExtensions(t *testing.T) {
102
102
err = ports .ExtractPortsInto (allPages , & allPorts )
103
103
th .AssertNoErr (t , err )
104
104
105
- th .AssertEquals (t , allPorts [0 ].Status , "ACTIVE" )
105
+ th .AssertEquals (t , allPorts [0 ].Status , ports . PortStatusActive )
106
106
th .AssertEquals (t , allPorts [0 ].PortSecurityEnabled , false )
107
107
}
108
108
@@ -123,7 +123,7 @@ func TestGet(t *testing.T) {
123
123
n , err := ports .Get (context .TODO (), fake .ServiceClient (), "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2" ).Extract ()
124
124
th .AssertNoErr (t , err )
125
125
126
- th .AssertEquals (t , n .Status , "ACTIVE" )
126
+ th .AssertEquals (t , n .Status , ports . PortStatusActive )
127
127
th .AssertEquals (t , n .Name , "" )
128
128
th .AssertEquals (t , n .AdminStateUp , true )
129
129
th .AssertEquals (t , n .NetworkID , "a87cc70a-3e15-4acf-8205-9b711a3531b7" )
@@ -135,7 +135,7 @@ func TestGet(t *testing.T) {
135
135
})
136
136
th .AssertEquals (t , n .ID , "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2" )
137
137
th .AssertDeepEquals (t , n .SecurityGroups , []string {})
138
- th .AssertEquals (t , n .Status , "ACTIVE" )
138
+ th .AssertEquals (t , n .Status , ports . PortStatusActive )
139
139
th .AssertEquals (t , n .DeviceID , "5e3898d7-11be-483e-9732-b2f5eccd2b2e" )
140
140
th .AssertEquals (t , n .CreatedAt , time .Date (2019 , time .June , 30 , 4 , 15 , 37 , 0 , time .UTC ))
141
141
th .AssertEquals (t , n .UpdatedAt , time .Date (2019 , time .June , 30 , 5 , 18 , 49 , 0 , time .UTC ))
@@ -163,7 +163,7 @@ func TestGetWithExtensions(t *testing.T) {
163
163
err := ports .Get (context .TODO (), fake .ServiceClient (), "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2" ).ExtractInto (& portWithExtensions )
164
164
th .AssertNoErr (t , err )
165
165
166
- th .AssertEquals (t , portWithExtensions .Status , "ACTIVE" )
166
+ th .AssertEquals (t , portWithExtensions .Status , ports . PortStatusActive )
167
167
th .AssertEquals (t , portWithExtensions .PortSecurityEnabled , false )
168
168
}
169
169
@@ -200,7 +200,7 @@ func TestCreate(t *testing.T) {
200
200
n , err := ports .Create (context .TODO (), fake .ServiceClient (), options ).Extract ()
201
201
th .AssertNoErr (t , err )
202
202
203
- th .AssertEquals (t , n .Status , "DOWN" )
203
+ th .AssertEquals (t , n .Status , ports . PortStatusDown )
204
204
th .AssertEquals (t , n .Name , "private-port" )
205
205
th .AssertEquals (t , n .AdminStateUp , true )
206
206
th .AssertEquals (t , n .NetworkID , "a87cc70a-3e15-4acf-8205-9b711a3531b7" )
@@ -249,7 +249,7 @@ func TestCreateOmitSecurityGroups(t *testing.T) {
249
249
n , err := ports .Create (context .TODO (), fake .ServiceClient (), options ).Extract ()
250
250
th .AssertNoErr (t , err )
251
251
252
- th .AssertEquals (t , n .Status , "DOWN" )
252
+ th .AssertEquals (t , n .Status , ports . PortStatusDown )
253
253
th .AssertEquals (t , n .Name , "private-port" )
254
254
th .AssertEquals (t , n .AdminStateUp , true )
255
255
th .AssertEquals (t , n .NetworkID , "a87cc70a-3e15-4acf-8205-9b711a3531b7" )
@@ -299,7 +299,7 @@ func TestCreateWithNoSecurityGroup(t *testing.T) {
299
299
n , err := ports .Create (context .TODO (), fake .ServiceClient (), options ).Extract ()
300
300
th .AssertNoErr (t , err )
301
301
302
- th .AssertEquals (t , n .Status , "DOWN" )
302
+ th .AssertEquals (t , n .Status , ports . PortStatusDown )
303
303
th .AssertEquals (t , n .Name , "private-port" )
304
304
th .AssertEquals (t , n .AdminStateUp , true )
305
305
th .AssertEquals (t , n .NetworkID , "a87cc70a-3e15-4acf-8205-9b711a3531b7" )
@@ -346,7 +346,7 @@ func TestCreateWithPropagateUplinkStatus(t *testing.T) {
346
346
n , err := ports .Create (context .TODO (), fake .ServiceClient (), options ).Extract ()
347
347
th .AssertNoErr (t , err )
348
348
349
- th .AssertEquals (t , n .Status , "DOWN" )
349
+ th .AssertEquals (t , n .Status , ports . PortStatusDown )
350
350
th .AssertEquals (t , n .Name , "private-port" )
351
351
th .AssertEquals (t , n .AdminStateUp , true )
352
352
th .AssertEquals (t , n .NetworkID , "a87cc70a-3e15-4acf-8205-9b711a3531b7" )
@@ -396,7 +396,7 @@ func TestCreateWithValueSpecs(t *testing.T) {
396
396
n , err := ports .Create (context .TODO (), fake .ServiceClient (), options ).Extract ()
397
397
th .AssertNoErr (t , err )
398
398
399
- th .AssertEquals (t , n .Status , "DOWN" )
399
+ th .AssertEquals (t , n .Status , ports . PortStatusDown )
400
400
th .AssertEquals (t , n .Name , "private-port" )
401
401
th .AssertEquals (t , n .AdminStateUp , true )
402
402
th .AssertEquals (t , n .NetworkID , "a87cc70a-3e15-4acf-8205-9b711a3531b7" )
@@ -513,7 +513,7 @@ func TestCreatePortSecurity(t *testing.T) {
513
513
err := ports .Create (context .TODO (), fake .ServiceClient (), createOpts ).ExtractInto (& portWithExt )
514
514
th .AssertNoErr (t , err )
515
515
516
- th .AssertEquals (t , portWithExt .Status , "DOWN" )
516
+ th .AssertEquals (t , portWithExt .Status , ports . PortStatusDown )
517
517
th .AssertEquals (t , portWithExt .PortSecurityEnabled , false )
518
518
}
519
519
@@ -687,7 +687,7 @@ func TestUpdatePortSecurity(t *testing.T) {
687
687
err := ports .Update (context .TODO (), fake .ServiceClient (), "65c0ee9f-d634-4522-8954-51021b570b0d" , updateOpts ).ExtractInto (& portWithExt )
688
688
th .AssertNoErr (t , err )
689
689
690
- th .AssertEquals (t , portWithExt .Status , "DOWN" )
690
+ th .AssertEquals (t , portWithExt .Status , ports . PortStatusDown )
691
691
th .AssertEquals (t , portWithExt .Name , "private-port" )
692
692
th .AssertEquals (t , portWithExt .PortSecurityEnabled , false )
693
693
}
@@ -898,7 +898,7 @@ func TestGetWithExtraDHCPOpts(t *testing.T) {
898
898
err := ports .Get (context .TODO (), fake .ServiceClient (), "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2" ).ExtractInto (& s )
899
899
th .AssertNoErr (t , err )
900
900
901
- th .AssertEquals (t , s .Status , "ACTIVE" )
901
+ th .AssertEquals (t , s .Status , ports . PortStatusActive )
902
902
th .AssertEquals (t , s .NetworkID , "a87cc70a-3e15-4acf-8205-9b711a3531b7" )
903
903
th .AssertEquals (t , s .TenantID , "d6700c0c9ffa4f1cb322cd4a1f3906fa" )
904
904
th .AssertEquals (t , s .AdminStateUp , true )
@@ -964,7 +964,7 @@ func TestCreateWithExtraDHCPOpts(t *testing.T) {
964
964
err := ports .Create (context .TODO (), fake .ServiceClient (), createOpts ).ExtractInto (& s )
965
965
th .AssertNoErr (t , err )
966
966
967
- th .AssertEquals (t , s .Status , "DOWN" )
967
+ th .AssertEquals (t , s .Status , ports . PortStatusDown )
968
968
th .AssertEquals (t , s .NetworkID , "a87cc70a-3e15-4acf-8205-9b711a3531b7" )
969
969
th .AssertEquals (t , s .TenantID , "d6700c0c9ffa4f1cb322cd4a1f3906fa" )
970
970
th .AssertEquals (t , s .AdminStateUp , true )
@@ -1029,7 +1029,7 @@ func TestUpdateWithExtraDHCPOpts(t *testing.T) {
1029
1029
err := ports .Update (context .TODO (), fake .ServiceClient (), "65c0ee9f-d634-4522-8954-51021b570b0d" , updateOpts ).ExtractInto (& s )
1030
1030
th .AssertNoErr (t , err )
1031
1031
1032
- th .AssertEquals (t , s .Status , "DOWN" )
1032
+ th .AssertEquals (t , s .Status , ports . PortStatusDown )
1033
1033
th .AssertEquals (t , s .NetworkID , "a87cc70a-3e15-4acf-8205-9b711a3531b7" )
1034
1034
th .AssertEquals (t , s .TenantID , "d6700c0c9ffa4f1cb322cd4a1f3906fa" )
1035
1035
th .AssertEquals (t , s .AdminStateUp , true )
0 commit comments