@@ -113,14 +113,14 @@ end_per_testcase(CaseName, Config) ->
113
113
% %% ==================================================================
114
114
115
115
migrate_pubsub_nodes (_Config ) ->
116
- Nidx = create_migration_node (),
116
+ _ = create_migration_node (),
117
117
{ok , _ } = ? RPC_MIGRATE (<<" pubsub_nodes" >>),
118
118
SqlData = #{table => <<" pubsub_nodes" >>, where => <<" name='" , ? NODE_NAME /binary , " '" >>},
119
- case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" nidx " >>}) of
120
- {selected , [{Nidx }]} ->
119
+ case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" name " >>}) of
120
+ {selected , [{? NODE_NAME }]} ->
121
121
{updated , 1 } = sql_to_rdbms (SqlData #{act => <<" DELETE" >>, column => <<" " >>}),
122
122
_ = clear_tables (),
123
- ct :comment (" Migration of 'pubsub_nodes' is successful for Nidx : ~p " , [Nidx ]);
123
+ ct :comment (" Migration of 'pubsub_nodes' is successful for 'name' : ~p " , [? NODE_NAME ]);
124
124
Any ->
125
125
ct :fail (" Unexpected result of 'pubsub_nodes' migration ~p~n " , [Any ])
126
126
end .
@@ -133,12 +133,12 @@ migrate_pubsub_subscriptions(_Config) ->
133
133
Nidx = create_migration_node (),
134
134
ok = mongoose_helper :successful_rpc (mod_pubsub_db_mnesia , transaction , [#{name => add_subscription , args => [Nidx , ? JID , 'subscribed' , <<" 0000-0000-0000000" >>, []]}]),
135
135
{ok , _ } = ? RPC_MIGRATE (<<" pubsub_subscriptions" >>),
136
- SqlData = #{table => <<" pubsub_subscriptions" >>, where => <<" nidx= " , ( list_to_binary ( integer_to_list ( Nidx ))) /binary >>},
137
- case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" nidx " >>}) of
138
- {selected , [{Nidx }]} ->
136
+ SqlData = #{table => <<" pubsub_subscriptions" >>, where => <<" luser=' " , ? USERNAME /binary , " ' " >>},
137
+ case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" luser " >>}) of
138
+ {selected , [{? USERNAME }]} ->
139
139
{updated , 1 } = sql_to_rdbms (SqlData #{act => <<" DELETE" >>, column => <<" " >>}),
140
140
_ = clear_tables (),
141
- ct :comment (" Migration of 'pubsub_subscriptions' is successful for Nidx : ~p " , [Nidx ]);
141
+ ct :comment (" Migration of 'pubsub_subscriptions' is successful for 'luser' : ~p " , [? USERNAME ]);
142
142
Any ->
143
143
ct :fail (" Unexpected result of 'pubsub_subscriptions' migration ~p~n " , [Any ])
144
144
end .
@@ -148,14 +148,14 @@ migrate_pubsub_subscriptions(_Config) ->
148
148
% %% ==================================================================
149
149
150
150
migrate_pubsub_affiliations (_Config ) ->
151
- Nidx = create_migration_node (),
151
+ _ = create_migration_node (),
152
152
{ok , _ } = ? RPC_MIGRATE (<<" pubsub_affiliations" >>),
153
- SqlData = #{table => <<" pubsub_affiliations" >>, where => <<" nidx= " , ( list_to_binary ( integer_to_list ( Nidx ))) /binary >>},
154
- case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" nidx " >>}) of
155
- {selected , [{Nidx }]} ->
153
+ SqlData = #{table => <<" pubsub_affiliations" >>, where => <<" luser=' " , ? USERNAME /binary , " ' " >>},
154
+ case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" luser " >>}) of
155
+ {selected , [{? USERNAME }]} ->
156
156
{updated , 1 } = sql_to_rdbms (SqlData #{act => <<" DELETE" >>, column => <<" " >>}),
157
157
_ = clear_tables (),
158
- ct :comment (" Migration of 'pubsub_affiliations' is successful for Nidx : ~p " , [Nidx ]);
158
+ ct :comment (" Migration of 'pubsub_affiliations' is successful for 'pubsub_affiliations' : ~p " , [? USERNAME ]);
159
159
Any ->
160
160
ct :fail (" Unexpected result of 'pubsub_affiliations' migration ~p~n " , [Any ])
161
161
end .
@@ -168,12 +168,12 @@ migrate_pubsub_items(_Config) ->
168
168
Nidx = create_migration_node (),
169
169
ok = mongoose_helper :successful_rpc (mod_pubsub_db_mnesia , transaction , [#{name => add_item , args => [Nidx , ? JID , ? BASE_ITEM (Nidx )]}]),
170
170
{ok , _ } = ? RPC_MIGRATE (<<" pubsub_items" >>),
171
- SqlData = #{table => <<" pubsub_items" >>, where => <<" nidx= " , ( list_to_binary ( integer_to_list ( Nidx ))) /binary >>},
172
- case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" nidx " >>}) of
173
- {selected , [{Nidx }]} ->
171
+ SqlData = #{table => <<" pubsub_items" >>, where => <<" created_luser=' " , ? USERNAME /binary , " ' " >>},
172
+ case sql_to_rdbms (SqlData #{act => <<" SELECT" >>, column => <<" created_luser " >>}) of
173
+ {selected , [{? USERNAME }]} ->
174
174
{updated , 1 } = sql_to_rdbms (SqlData #{act => <<" DELETE" >>, column => <<" " >>}),
175
175
_ = clear_tables (),
176
- ct :comment (" Migration of 'pubsub_items' is successful for Nidx : ~p " , [Nidx ]);
176
+ ct :comment (" Migration of 'pubsub_items' is successful for 'created_luser' : ~p " , [? USERNAME ]);
177
177
Any ->
178
178
ct :fail (" Unexpected result of 'pubsub_items' migration ~p~n " , [Any ])
179
179
end .
@@ -216,7 +216,7 @@ migrate_vcard_search(_Config) ->
216
216
% %% Test case for migrate vcard
217
217
% %% ==================================================================
218
218
219
- migrate_vcard (Config ) ->
219
+ migrate_vcard (_Config ) ->
220
220
ok = set_vcard (),
221
221
{ok , _ } = ? RPC_MIGRATE (<<" vcard" >>),
222
222
SqlData = #{table => <<" vcard" >>, where => <<" username='" , ? USERNAME /binary , " '" >>},
@@ -233,7 +233,7 @@ migrate_vcard(Config) ->
233
233
% %% Test case for migrate event_pusher_push_subscription
234
234
% %% ==================================================================
235
235
236
- migrate_event_pusher_push_subscription (Config ) ->
236
+ migrate_event_pusher_push_subscription (_Config ) ->
237
237
PubsubNode = <<" migration_pub_sub_node" >>,
238
238
ok = mongoose_helper :successful_rpc (mod_event_pusher_push_mnesia , enable , [? JID , ? JID , PubsubNode , [{<<" name" >>, <<" value" >>}]]),
239
239
{ok , _ } = ? RPC_MIGRATE (<<" event_pusher_push_subscription" >>),
@@ -251,63 +251,63 @@ migrate_event_pusher_push_subscription(Config) ->
251
251
% %% Test case for migrate rosterusers @TODO
252
252
% %% ==================================================================
253
253
254
- migrate_rosterusers (Config ) ->
254
+ migrate_rosterusers (_Config ) ->
255
255
? RPC_MIGRATE (<<" rosterusers" >>),
256
256
ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
257
257
258
258
% %% ==================================================================
259
259
% %% Test case for migrate roster_version @TODO
260
260
% %% ==================================================================
261
261
262
- migrate_roster_version (Config ) ->
262
+ migrate_roster_version (_Config ) ->
263
263
? RPC_MIGRATE (<<" roster_version" >>),
264
264
ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
265
265
266
266
% %% ==================================================================
267
267
% %% Test case for migrate rostergroups @TODO
268
268
% %% ==================================================================
269
269
270
- migrate_rostergroups (Config ) ->
270
+ migrate_rostergroups (_Config ) ->
271
271
? RPC_MIGRATE (<<" rostergroups" >>),
272
272
ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
273
273
274
274
% %% ==================================================================
275
275
% %% Test case for migrate last @TODO
276
276
% %% ==================================================================
277
277
278
- migrate_last (Config ) ->
278
+ migrate_last (_Config ) ->
279
279
? RPC_MIGRATE (<<" last" >>),
280
280
ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
281
281
282
282
% %% ==================================================================
283
283
% %% Test case for migrate private_storage @TODO
284
284
% %% ==================================================================
285
285
286
- migrate_private_storage (Config ) ->
286
+ migrate_private_storage (_Config ) ->
287
287
? RPC_MIGRATE (<<" private_storage" >>),
288
288
ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
289
289
290
290
% %% ==================================================================
291
291
% %% Test case for migrate offline_message @TODO
292
292
% %% ==================================================================
293
293
294
- migrate_offline_message (Config ) ->
294
+ migrate_offline_message (_Config ) ->
295
295
? RPC_MIGRATE (<<" offline_message" >>),
296
296
ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
297
297
298
298
% %% ==================================================================
299
299
% %% Test case for migrate muc_light_rooms @TODO
300
300
% %% ==================================================================
301
301
302
- migrate_muc_light_rooms (Config ) ->
302
+ migrate_muc_light_rooms (_Config ) ->
303
303
? RPC_MIGRATE (<<" muc_light_rooms" >>),
304
304
ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
305
305
306
306
% %% ==================================================================
307
307
% %% Test case for migrate all @TODO
308
308
% %% ==================================================================
309
309
310
- migrate_all (Config ) ->
310
+ migrate_all (_Config ) ->
311
311
? RPC_MIGRATE (<<" all" >>),
312
312
ct :comment (" TEST CASE ~p " , [? FUNCTION_NAME ]).
313
313
@@ -331,7 +331,7 @@ slow_rpc(M, F, A) ->
331
331
332
332
sql_to_rdbms (#{act := Act , column := Column , table := Table , where := Where }) ->
333
333
SelectQuery = <<Act /binary , " " , Column /binary , " FROM " , Table /binary , " WHERE " , Where /binary >>,
334
- SelectResult = sql_query (SelectQuery ).
334
+ sql_query (SelectQuery ).
335
335
336
336
clear_tables () ->
337
337
Tables = [pubsub_state , pubsub_item , pubsub_node ,
@@ -346,4 +346,4 @@ create_migration_node() ->
346
346
Nidx .
347
347
348
348
set_vcard () ->
349
- mongoose_helper :successful_rpc (mod_vcard_mnesia , set_vcard , [? USERNAME , <<" localhost" >>, ? BASE_VCARD , ? BASE_SEARCH_VCARD ]).
349
+ mongoose_helper :successful_rpc (mod_vcard_mnesia , set_vcard , [? USERNAME , <<" localhost" >>, ? BASE_VCARD , ? BASE_SEARCH_VCARD ]).
0 commit comments