Debian Codegraph @

mysql-test/suite/x/t/capabilities.test

raw
1 call mtr.add_suppression("Capability expired password failed with error: Invalid data, expected numeric type");
2 --sleep 2
3 --source include/xplugin_preamble.inc
4 --source include/xplugin_ssl_warnings_suppression.inc
5 --source include/xplugin_create_user.inc
6
7 --write_file $MYSQL_TMP_DIR/mysqlx-capabilities-get.xpl
8 -->import connection.macro
9 -->callmacro Verify_its_xprotocol_connection
10 Mysqlx.Connection.CapabilitiesGet {
11 }
12 -->recv
13 EOF
14
15 --write_file $MYSQL_TMP_DIR/mysqlx-capabilities-get-success.xpl
16 -->import connection.macro
17 -->callmacro Verify_its_xprotocol_connection
18
19 Mysqlx.Connection.CapabilitiesGet {
20 }
21 -->recv
22
23 -->echo setting Not existing capability,expect error
24 Mysqlx.Connection.CapabilitiesSet {
25 capabilities {
26 capabilities {
27 name: "NotExistingCapability"
28 value {
29 type: SCALAR
30 scalar {
31 type: V_BOOL
32 v_bool: 1
33 }
34 }
35 }
36 }
37 }
38
39 -->recvtype Mysqlx.Error
40
41 -->echo try setting read only doc.formats capabilities
42 Mysqlx.Connection.CapabilitiesSet {
43 capabilities {
44 capabilities {
45 name: "doc.formats"
46 value {
47 type: SCALAR
48 scalar {
49 type: V_STRING
50 v_string {
51 value: "text"
52 }
53 }
54 }
55 }
56 }
57 }
58 -->recvtype Mysqlx.Error
59
60 -->echo Try setting auth capabilities which is read only
61 Mysqlx.Connection.CapabilitiesSet {
62 capabilities {
63 capabilities {
64 name: "authentication.mechanisms"
65 value {
66 type: ARRAY
67 array {
68 value {
69 type: SCALAR
70 scalar {
71 type: V_STRING
72 v_string {
73 value: "MYSQL41"
74 }
75 }
76 }
77 value {
78 type: SCALAR
79 scalar {
80 type: V_STRING
81 v_string {
82 value: "PLAIN"
83 }
84 }
85 }
86 }
87 }
88 }
89 }
90 }
91 -->recvtype Mysqlx.Error
92
93 -->echo Error when setting a duplicated capability
94 Mysqlx.Connection.CapabilitiesSet {
95 capabilities {
96 capabilities {
97 name: "client.interactive"
98 value {
99 type: SCALAR
100 scalar {
101 type: V_BOOL
102 v_bool: 1
103 }
104 }
105 }
106 capabilities {
107 name: "client.interactive"
108 value {
109 type: SCALAR
110 scalar {
111 type: V_BOOL
112 v_bool: 1
113 }
114 }
115 }
116 }
117 }
118 -->recverror ER_X_DUPLICATED_CAPABILITIES
119 -->echo After setting a duplicated capability it should be possible to set valid capability
120 Mysqlx.Connection.CapabilitiesSet {
121 capabilities {
122 capabilities {
123 name: "client.interactive"
124 value {
125 type: SCALAR
126 scalar {
127 type: V_BOOL
128 v_bool: 1
129 }
130 }
131 }
132 }
133 }
134 -->recvok
135
136 -->echo setting Read only message.maxSendLength cap
137 -->echo this param is not ready and needs changes in result file once available
138 Mysqlx.Connection.CapabilitiesSet {
139 capabilities {
140 capabilities {
141 name: "message.maxSendLength"
142 value {
143 type: SCALAR
144 scalar {
145 type: V_STRING
146 v_string {
147 value: "int32"
148 }
149 }
150 }
151 }
152 }
153 }
154 -->recvtype Mysqlx.Error
155
156 -->echo setting Read only message.maxReceiveLength cap
157 -->echo this param is not ready and needs changes in result file once available
158 Mysqlx.Connection.CapabilitiesSet {
159 capabilities {
160 capabilities {
161 name: "message.maxReceiveLength"
162 value {
163 type: SCALAR
164 scalar {
165 type: V_STRING
166 v_string {
167 value: "int32"
168 }
169 }
170 }
171 }
172 }
173 }
174 -->recvtype Mysqlx.Error
175
176 -->echo setting read/write tls param with true while the SSL isn't configured
177 Mysqlx.Connection.CapabilitiesSet {
178 capabilities {
179 capabilities {
180 name: "tls"
181 value {
182 type: SCALAR
183 scalar {
184 type: V_BOOL
185 v_bool:1
186 }
187 }
188 }
189 }
190 }
191 -->recvtype Mysqlx.Error
192
193 -->echo setting read/write tls param with false while the SSL isn't configured
194 Mysqlx.Connection.CapabilitiesSet {
195 capabilities {
196 capabilities {
197 name: "tls"
198 value {
199 type: SCALAR
200 scalar {
201 type: V_BOOL
202 v_bool:0
203 }
204 }
205 }
206 }
207 }
208 -->recvtype Mysqlx.Error
209 EOF
210 --write_file $MYSQL_TMP_DIR/mysqlx-capabilities-failure.xpl
211 -->import connection.macro
212 -->callmacro Verify_its_xprotocol_connection
213
214 -->echo setting read/write tls param with String type instead of Bool
215 Mysqlx.Connection.CapabilitiesSet {
216 capabilities {
217 capabilities {
218 name: "tls"
219 value {
220 type: SCALAR
221 scalar {
222 type: V_STRING
223 v_string {value: "1"}
224 }
225 }
226 }
227 }
228 }
229 -->recvtype Mysqlx.Error
230 EOF
231
232 --write_file $MYSQL_TMP_DIR/mysqlx-setcapabilities-invalid.xpl
233 -->import connection.macro
234 -->callmacro Verify_its_xprotocol_connection
235
236 -->echo setting read/write tls param with possible data types V_SINT,V_UINT ,V_NULL,V_OCTETS ,V_DOUBLE,V_FLOAT,V_STRING types instead of Bool
237 Mysqlx.Connection.CapabilitiesSet {
238 capabilities {
239 capabilities {
240 name: "tls"
241 value {
242 type: SCALAR
243 scalar {
244 type: V_FLOAT
245 v_float:19.49
246 }
247 }
248 }
249 }
250 }
251 -->recvtype Mysqlx.Error
252
253 Mysqlx.Connection.CapabilitiesSet {
254 capabilities {
255 capabilities {
256 name: "tls"
257 value {
258 type: SCALAR
259 scalar {
260 type: V_DOUBLE
261 v_double:1111111
262 }
263 }
264 }
265 }
266 }
267 -->recvtype Mysqlx.Error
268
269 Mysqlx.Connection.CapabilitiesSet {
270 capabilities {
271 capabilities {
272 name: "tls"
273 value {
274 type: SCALAR
275 scalar {
276 type: V_NULL
277 }
278 }
279 }
280 }
281 }
282 -->recvtype Mysqlx.Error
283
284 Mysqlx.Connection.CapabilitiesSet {
285 capabilities {
286 capabilities {
287 name: "tls"
288 value {
289 type: SCALAR
290 scalar {
291 type:V_OCTETS
292 }
293 }
294 }
295 }
296 }
297 -->recvtype Mysqlx.Error
298
299 Mysqlx.Connection.CapabilitiesSet {
300 capabilities {
301 capabilities {
302 name: "tls"
303 value {
304 type: SCALAR
305 scalar {
306 type:V_UINT
307 }
308 }
309 }
310 }
311 }
312 -->recvtype Mysqlx.Error
313
314 Mysqlx.Connection.CapabilitiesSet {
315 capabilities {
316 capabilities {
317 name: "tls"
318 value {
319 type: SCALAR
320 scalar {
321 type:V_SINT
322 }
323 }
324 }
325 }
326 }
327 -->recvtype Mysqlx.Error
328
329 EOF
330
331 --write_file $MYSQL_TMP_DIR/mysqlx-check-bool-capabilities.xpl
332 -->import connection.macro
333 -->callmacro Verify_its_xprotocol_connection
334
335 -->macro Test_different_values_in_cap_set %NAME%
336 -->echo setting %NAME% param with possible invalid data types
337
338 -->echo setting %NAME% capability
339 Mysqlx.Connection.CapabilitiesSet {
340 capabilities {
341 capabilities {
342 name: %NAME%
343 value {
344 type: SCALAR
345 scalar {
346 type: V_BOOL
347 v_bool: 0
348 }
349 }
350 }
351 }
352 }
353 -->recvtype Mysqlx.Ok
354
355 Mysqlx.Connection.CapabilitiesSet {
356 capabilities {
357 capabilities {
358 name: %NAME%
359 value {
360 type: SCALAR
361 scalar {
362 type: V_BOOL
363 v_bool: 1
364 }
365 }
366 }
367 }
368 }
369 -->recvtype Mysqlx.Ok
370
371 Mysqlx.Connection.CapabilitiesSet {
372 capabilities {
373 capabilities {
374 name: %NAME%
375 value {
376 type: SCALAR
377 scalar {
378 type: V_FLOAT
379 v_float:1.0
380 }
381 }
382 }
383 }
384 }
385 -->recvtype Mysqlx.Ok
386
387 Mysqlx.Connection.CapabilitiesSet {
388 capabilities {
389 capabilities {
390 name: %NAME%
391 value {
392 type: SCALAR
393 scalar {
394 type: V_FLOAT
395 v_float:0.0
396 }
397 }
398 }
399 }
400 }
401 -->recvtype Mysqlx.Ok
402
403 Mysqlx.Connection.CapabilitiesSet {
404 capabilities {
405 capabilities {
406 name: %NAME%
407 value {
408 type: SCALAR
409 scalar {
410 type: V_DOUBLE
411 v_double:1.0
412 }
413 }
414 }
415 }
416 }
417 -->recvtype Mysqlx.Ok
418
419 Mysqlx.Connection.CapabilitiesSet {
420 capabilities {
421 capabilities {
422 name: %NAME%
423 value {
424 type: SCALAR
425 scalar {
426 type: V_DOUBLE
427 v_double:0.0
428 }
429 }
430 }
431 }
432 }
433 -->recvtype Mysqlx.Ok
434
435 Mysqlx.Connection.CapabilitiesSet {
436 capabilities {
437 capabilities {
438 name: %NAME%
439 value {
440 type: SCALAR
441 scalar {
442 type: V_UINT
443 v_unsigned_int:1
444 }
445 }
446 }
447 }
448 }
449 -->recvtype Mysqlx.Ok
450
451 Mysqlx.Connection.CapabilitiesSet {
452 capabilities {
453 capabilities {
454 name: %NAME%
455 value {
456 type: SCALAR
457 scalar {
458 type: V_UINT
459 v_unsigned_int:0
460 }
461 }
462 }
463 }
464 }
465 -->recvtype Mysqlx.Ok
466
467 Mysqlx.Connection.CapabilitiesSet {
468 capabilities {
469 capabilities {
470 name: %NAME%
471 value {
472 type: SCALAR
473 scalar {
474 type: V_SINT
475 v_signed_int:1
476 }
477 }
478 }
479 }
480 }
481 -->recvtype Mysqlx.Ok
482
483 Mysqlx.Connection.CapabilitiesSet {
484 capabilities {
485 capabilities {
486 name: %NAME%
487 value {
488 type: SCALAR
489 scalar {
490 type: V_SINT
491 v_signed_int:0
492 }
493 }
494 }
495 }
496 }
497 -->recvtype Mysqlx.Ok
498
499 -->endmacro
500
501 -->callmacro Test_different_values_in_cap_set "client.pwd_expire_ok"
502 -->callmacro Test_different_values_in_cap_set "client.interactive"
503
504 EOF
505
506 --write_file $MYSQL_TMP_DIR/mysqlx-setcapabilities-tls-invalid.xpl
507 -->import connection.macro
508 -->callmacro Verify_its_xprotocol_connection
509
510 -->echo setting read/write tls param with possible invalid data types V_SINT,V_UINT ,V_NULL,V_OCTETS ,V_DOUBLE,V_FLOAT,V_STRING types instead of Bool
511 Mysqlx.Connection.CapabilitiesGet {
512 }
513
514 -->recvtype Mysqlx.Connection.Capabilities
515
516 Mysqlx.Connection.CapabilitiesSet {
517 capabilities {
518 capabilities {
519 name: "tls"
520 value {
521 type: SCALAR
522 scalar {
523 type: V_BOOL
524 v_bool: 0
525 }
526 }
527 }
528 }
529 }
530
531 -->recv
532
533 Mysqlx.Connection.CapabilitiesSet {
534 capabilities {
535 capabilities {
536 name: "tls"
537 value {
538 type: SCALAR
539 scalar {
540 type: V_FLOAT
541 v_float:19.49
542 }
543 }
544 }
545 }
546 }
547 -->recv
548
549 Mysqlx.Connection.CapabilitiesSet {
550 capabilities {
551 capabilities {
552 name: "tls"
553 value {
554 type: SCALAR
555 scalar {
556 type: V_DOUBLE
557 v_double:1111111
558 }
559 }
560 }
561 }
562 }
563 -->recv
564
565 Mysqlx.Connection.CapabilitiesSet {
566 capabilities {
567 capabilities {
568 name: "tls"
569 value {
570 type: SCALAR
571 scalar {
572 type: V_NULL
573 }
574 }
575 }
576 }
577 }
578 -->recv
579
580 Mysqlx.Connection.CapabilitiesSet {
581 capabilities {
582 capabilities {
583 name: "tls"
584 value {
585 type: SCALAR
586 scalar {
587 type:V_OCTETS
588 }
589 }
590 }
591 }
592 }
593 -->recv
594
595 Mysqlx.Connection.CapabilitiesSet {
596 capabilities {
597 capabilities {
598 name: "tls"
599 value {
600 type: SCALAR
601 scalar {
602 type:V_UINT
603 }
604 }
605 }
606 }
607 }
608 -->recv
609
610 Mysqlx.Connection.CapabilitiesSet {
611 capabilities {
612 capabilities {
613 name: "tls"
614 value {
615 type: SCALAR
616 scalar {
617 type:V_SINT
618 }
619 }
620 }
621 }
622 }
623 -->recv
624
625 EOF
626
627 --exec $MYSQLXTEST -u x_root --password='' -h127.0.0.1 --no-auth --file=$MYSQL_TMP_DIR/mysqlx-capabilities-get-success.xpl 2>&1
628
629 --exec $MYSQLXTEST -u x_root --password='' -h127.0.0.1 --no-auth --file=$MYSQL_TMP_DIR/mysqlx-capabilities-failure.xpl 2>&1
630
631 --exec $MYSQLXTEST -u x_root --password='' -h127.0.0.1 --no-auth --file=$MYSQL_TMP_DIR/mysqlx-setcapabilities-invalid.xpl 2>&1
632
633 --exec $MYSQLXTEST -u x_root --password='' -h127.0.0.1 --no-auth --ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem --file=$MYSQL_TMP_DIR/mysqlx-setcapabilities-tls-invalid.xpl 2>&1
634
635 --exec $MYSQLXTEST -u x_root --password='' -h127.0.0.1 --no-auth --file=$MYSQL_TMP_DIR/mysqlx-setcapabilities-tls-invalid.xpl 2>&1
636
637 --exec $MYSQLXTEST -u root --password='' -h127.0.0.1 --no-auth --file=$MYSQL_TMP_DIR/mysqlx-check-bool-capabilities.xpl 2>&1
638
639 #check Get and Set capabilities with invalid user details
640 --exec $MYSQLXTEST -u invalid --password='invalid' -h127.0.0.1 --no-auth --file=$MYSQL_TMP_DIR/mysqlx-capabilities-get-success.xpl 2>&1
641
642 --echo Restart server and verify if ssl callback works
643 let $restart_parameters = restart: --ssl=1;
644 --source include/restart_mysqld.inc
645
646 --echo capabilities.result checks the presence of tls cap
647 --exec $MYSQLXTEST -u x_root --password='' -h127.0.0.1 --no-auth --file=$MYSQL_TMP_DIR/mysqlx-capabilities-get.xpl 2>&1
648
649 ## Cleanup
650 --let $restart_parameters = restart:
651 --source include/restart_mysqld.inc
652
653 --source ../include/xplugin_cleanup.inc