@@ -105,32 +105,42 @@ func (vcd *TestVCD) Test_UpdateOrg(check *C) {
105
105
check .Skip (fmt .Sprintf (TestRequiresSysAdminPrivileges , check .TestName ()))
106
106
}
107
107
type updateSet struct {
108
- orgName string
109
- enabled bool
110
- canPublishCatalogs bool
108
+ orgName string
109
+ enabled bool
110
+ canPublishCatalogs bool
111
+ canPublishExternally bool
112
+ canSubscribe bool
111
113
}
112
114
113
115
// Tests a combination of enabled and canPublishCatalogs to see
114
116
// whether they are updated correctly
115
117
var updateOrgs = []updateSet {
116
- {TestUpdateOrg + "1" , true , false },
117
- {TestUpdateOrg + "2" , false , false },
118
- {TestUpdateOrg + "3" , true , true },
119
- {TestUpdateOrg + "4" , false , true },
118
+ {TestUpdateOrg + "1" , true , false , false , false },
119
+ {TestUpdateOrg + "2" , false , false , false , false },
120
+ {TestUpdateOrg + "3" , true , true , true , false },
121
+ {TestUpdateOrg + "4" , false , true , false , true },
120
122
}
121
123
122
124
for _ , uo := range updateOrgs {
123
125
124
126
fmt .Printf ("Org %s - enabled %v - catalogs %v\n " , uo .orgName , uo .enabled , uo .canPublishCatalogs )
125
127
task , err := CreateOrg (vcd .client , uo .orgName , uo .orgName , uo .orgName , & types.OrgSettings {
126
- OrgGeneralSettings : & types.OrgGeneralSettings {CanPublishCatalogs : uo .canPublishCatalogs },
127
- OrgLdapSettings : & types.OrgLdapSettingsType {OrgLdapMode : "NONE" },
128
+ OrgGeneralSettings : & types.OrgGeneralSettings {
129
+ CanPublishCatalogs : uo .canPublishCatalogs ,
130
+ CanPublishExternally : uo .canPublishExternally ,
131
+ CanSubscribe : uo .canSubscribe ,
132
+ },
133
+ OrgLdapSettings : & types.OrgLdapSettingsType {OrgLdapMode : "NONE" },
128
134
}, uo .enabled )
135
+
129
136
check .Assert (err , IsNil )
130
137
check .Assert (task , Not (Equals ), Task {})
138
+
131
139
err = task .WaitTaskCompletion ()
132
140
check .Assert (err , IsNil )
141
+
133
142
AddToCleanupList (uo .orgName , "org" , "" , "TestUpdateOrg" )
143
+
134
144
// fetch newly created org
135
145
adminOrg , err := vcd .client .GetAdminOrgByName (uo .orgName )
136
146
check .Assert (err , IsNil )
@@ -144,6 +154,9 @@ func (vcd *TestVCD) Test_UpdateOrg(check *C) {
144
154
adminOrg .AdminOrg .Description = updatedDescription
145
155
adminOrg .AdminOrg .FullName = updatedFullName
146
156
adminOrg .AdminOrg .OrgSettings .OrgGeneralSettings .CanPublishCatalogs = ! uo .canPublishCatalogs
157
+ adminOrg .AdminOrg .OrgSettings .OrgGeneralSettings .CanPublishExternally = ! uo .canPublishExternally
158
+ adminOrg .AdminOrg .OrgSettings .OrgGeneralSettings .CanSubscribe = ! uo .canSubscribe
159
+
147
160
adminOrg .AdminOrg .IsEnabled = ! uo .enabled
148
161
149
162
task , err = adminOrg .Update ()
@@ -160,6 +173,8 @@ func (vcd *TestVCD) Test_UpdateOrg(check *C) {
160
173
161
174
check .Assert (updatedAdminOrg .AdminOrg .IsEnabled , Equals , ! uo .enabled )
162
175
check .Assert (updatedAdminOrg .AdminOrg .OrgSettings .OrgGeneralSettings .CanPublishCatalogs , Equals , ! uo .canPublishCatalogs )
176
+ check .Assert (updatedAdminOrg .AdminOrg .OrgSettings .OrgGeneralSettings .CanPublishExternally , Equals , ! uo .canPublishExternally )
177
+ check .Assert (updatedAdminOrg .AdminOrg .OrgSettings .OrgGeneralSettings .CanSubscribe , Equals , ! uo .canSubscribe )
163
178
if testVerbose {
164
179
fmt .Printf ("[updated] Org %s - enabled %v (expected %v) - catalogs %v (expected %v)\n " ,
165
180
updatedAdminOrg .AdminOrg .Name ,
0 commit comments