@@ -82,19 +82,22 @@ def test_exec(config, ssh_con):
82
82
ConfigOpts .rgw_lc_debug_interval ,
83
83
str (config .rgw_lc_debug_interval ),
84
84
ssh_con ,
85
+ set_to_all = config .test_ops .get ("set_ceph_configs_to_all_daemons" , False ),
85
86
)
86
87
if not config .rgw_enable_lc_threads :
87
88
ceph_conf .set_to_ceph_conf (
88
89
"global" ,
89
90
ConfigOpts .rgw_enable_lc_threads ,
90
91
str (config .rgw_enable_lc_threads ),
91
92
ssh_con ,
93
+ set_to_all = config .test_ops .get ("set_ceph_configs_to_all_daemons" , False ),
92
94
)
93
95
ceph_conf .set_to_ceph_conf (
94
96
"global" ,
95
97
ConfigOpts .rgw_lifecycle_work_time ,
96
98
str (config .rgw_lifecycle_work_time ),
97
99
ssh_con ,
100
+ set_to_all = config .test_ops .get ("set_ceph_configs_to_all_daemons" , False ),
98
101
)
99
102
_ , version_name = utils .get_ceph_version ()
100
103
if "nautilus" in version_name :
@@ -110,6 +113,72 @@ def test_exec(config, ssh_con):
110
113
option = ConfigOpts .rgw_lc_max_worker ,
111
114
value = str (config .rgw_lc_max_worker ),
112
115
ssh_con = ssh_con ,
116
+ set_to_all = config .test_ops .get ("set_ceph_configs_to_all_daemons" , False ),
117
+ )
118
+ ceph_conf .set_to_ceph_conf (
119
+ "global" ,
120
+ ConfigOpts .rgw_lc_max_wp_worker ,
121
+ str (config .rgw_lc_max_wp_worker ),
122
+ ssh_con ,
123
+ set_to_all = config .test_ops .get ("set_ceph_configs_to_all_daemons" , False ),
124
+ )
125
+ log .info (f"test_lc_on_other_site: { config .test_ops .get ('test_lc_on_other_site' )} " )
126
+ if config .test_ops .get ("test_lc_on_other_site" , False ) is True :
127
+ log .info (f"other_site_master: { config .test_ops .get ('other_site_master' )} " )
128
+ other_site_rgw_ip = utils .get_rgw_ip (
129
+ config .test_ops .get ("other_site_master" , False )
130
+ )
131
+ log .info (f"other_site_rgw_ip: { other_site_rgw_ip } " )
132
+ other_site_ssh_con = utils .connect_remote (other_site_rgw_ip )
133
+ log .info (f"other_site_ssh_con: { other_site_ssh_con } " )
134
+ ceph_conf .set_to_ceph_conf (
135
+ "global" ,
136
+ ConfigOpts .rgw_lc_debug_interval ,
137
+ str (config .rgw_lc_debug_interval ),
138
+ remote_ssh_con = other_site_ssh_con ,
139
+ set_to_all = config .test_ops .get ("set_ceph_configs_to_all_daemons" , False ),
140
+ )
141
+ if not config .rgw_enable_lc_threads :
142
+ ceph_conf .set_to_ceph_conf (
143
+ "global" ,
144
+ ConfigOpts .rgw_enable_lc_threads ,
145
+ str (config .rgw_enable_lc_threads ),
146
+ remote_ssh_con = other_site_ssh_con ,
147
+ set_to_all = config .test_ops .get (
148
+ "set_ceph_configs_to_all_daemons" , False
149
+ ),
150
+ )
151
+ ceph_conf .set_to_ceph_conf (
152
+ "global" ,
153
+ ConfigOpts .rgw_lifecycle_work_time ,
154
+ str (config .rgw_lifecycle_work_time ),
155
+ remote_ssh_con = other_site_ssh_con ,
156
+ set_to_all = config .test_ops .get ("set_ceph_configs_to_all_daemons" , False ),
157
+ )
158
+ _ , version_name = utils .get_ceph_version ()
159
+ if "nautilus" in version_name :
160
+ ceph_conf .set_to_ceph_conf (
161
+ "global" ,
162
+ ConfigOpts .rgw_lc_max_worker ,
163
+ str (config .rgw_lc_max_worker ),
164
+ remote_ssh_con = other_site_ssh_con ,
165
+ )
166
+ else :
167
+ ceph_conf .set_to_ceph_conf (
168
+ section = None ,
169
+ option = ConfigOpts .rgw_lc_max_worker ,
170
+ value = str (config .rgw_lc_max_worker ),
171
+ remote_ssh_con = other_site_ssh_con ,
172
+ set_to_all = config .test_ops .get (
173
+ "set_ceph_configs_to_all_daemons" , False
174
+ ),
175
+ )
176
+ ceph_conf .set_to_ceph_conf (
177
+ "global" ,
178
+ ConfigOpts .rgw_lc_max_wp_worker ,
179
+ str (config .rgw_lc_max_wp_worker ),
180
+ ssh_con ,
181
+ set_to_all = config .test_ops .get ("set_ceph_configs_to_all_daemons" , False ),
113
182
)
114
183
115
184
if config .test_lc_transition :
@@ -120,6 +189,12 @@ def test_exec(config, ssh_con):
120
189
121
190
log .info ("trying to restart services" )
122
191
srv_restarted = rgw_service .restart (ssh_con )
192
+
193
+ if config .test_ops .get ("set_ceph_configs_to_all_daemons" , False ):
194
+ utils .restart_rgw (restart_all = True )
195
+ if config .test_ops .get ("test_lc_on_other_site" , False ):
196
+ utils .restart_rgw (restart_all = True , ssh_con = other_site_ssh_con )
197
+
123
198
time .sleep (30 )
124
199
if srv_restarted is False :
125
200
raise TestExecError ("RGW service restart failed" )
@@ -143,7 +218,9 @@ def test_exec(config, ssh_con):
143
218
)
144
219
else :
145
220
log .info (f"user count is { config .user_count } " )
146
- user_info = s3lib .create_users (config .user_count )
221
+ user_info = s3lib .create_users (
222
+ config .user_count , config .user_names , config = config
223
+ )
147
224
log .info (f"print user info { user_info } " )
148
225
149
226
if config .test_ops .get ("send_bucket_notifications" , False ) is True :
@@ -161,9 +238,12 @@ def test_exec(config, ssh_con):
161
238
162
239
log .info ("no of buckets to create: %s" % config .bucket_count )
163
240
for bc in range (config .bucket_count ):
164
- bucket_name = utils .gen_bucket_name_from_userid (
165
- each_user ["user_id" ], rand_no = bc
166
- )
241
+ if config .bucket_names :
242
+ bucket_name = config .bucket_names [bc ]
243
+ else :
244
+ bucket_name = utils .gen_bucket_name_from_userid (
245
+ each_user ["user_id" ], rand_no = bc
246
+ )
167
247
obj_list = []
168
248
obj_tag = "suffix1=WMV1"
169
249
bucket = reusable .create_bucket (bucket_name , rgw_conn , each_user )
@@ -691,10 +771,19 @@ def test_exec(config, ssh_con):
691
771
reusable .put_bucket_lifecycle (
692
772
bucket , rgw_conn , rgw_conn2 , life_cycle_rule
693
773
)
774
+ if config .test_ops .get ("lc_grace_time" ):
775
+ log .info (
776
+ f"sleeping for lc_grace_time { config .test_ops .get ('lc_grace_time' )} seconds"
777
+ )
778
+ time .sleep (config .test_ops .get ("lc_grace_time" ))
694
779
time .sleep (60 )
695
780
for bucket in buckets :
696
781
if not config .test_ops .get ("enable_versioning" , False ) is True :
697
782
lc_ops .validate_prefix_rule_non_versioned (bucket , config )
783
+ if config .test_ops .get ("test_lc_on_other_site" , False ):
784
+ lc_ops .validate_prefix_rule_non_versioned (
785
+ bucket , config , other_site_ssh_con
786
+ )
698
787
else :
699
788
lc_ops .validate_prefix_rule (bucket , config )
700
789
if config .test_ops .get ("send_bucket_notifications" , False ) is True :
@@ -706,9 +795,14 @@ def test_exec(config, ssh_con):
706
795
)
707
796
rgw_service .restart ()
708
797
time .sleep (30 )
798
+
799
+ if config .test_ops .get ("delete_bucket_object" , False ):
800
+ for bucket in buckets :
801
+ reusable .delete_bucket (bucket )
802
+
709
803
if config .test_ops .get ("test_via_rgw_accounts" , False ) is True :
710
804
log .info ("do not remove user" )
711
- else :
805
+ elif config . user_remove :
712
806
reusable .remove_user (each_user )
713
807
# check for any crashes during the execution
714
808
crash_info = reusable .check_for_crash ()
0 commit comments