|
12 | 12 | linode_to_add, |
13 | 13 | nodebalancer_w_config_and_node, |
14 | 14 | nodebalancer_with_default_conf, |
| 15 | + nodebalancer_with_udp_config_and_node, |
| 16 | + simple_nodebalancer_with_config, |
15 | 17 | ) |
16 | 18 |
|
17 | 19 |
|
@@ -340,5 +342,151 @@ def test_list_multiple_configuration_profile(nodebalancer_w_config_and_node): |
340 | 342 | ) |
341 | 343 |
|
342 | 344 |
|
| 345 | +def test_update_node_balancer_udp_configuration(simple_nodebalancer_with_config): |
| 346 | + nodebalancer_id = simple_nodebalancer_with_config[0] |
| 347 | + config_id = simple_nodebalancer_with_config[1] |
| 348 | + |
| 349 | + result = exec_test_command( |
| 350 | + BASE_CMDS["nodebalancers"] |
| 351 | + + [ |
| 352 | + "config-update", |
| 353 | + nodebalancer_id, |
| 354 | + config_id, |
| 355 | + "--port", "80", |
| 356 | + "--protocol", "udp", |
| 357 | + "--algorithm", "roundrobin", |
| 358 | + "--check_interval", "80", |
| 359 | + "--check_timeout", "15", |
| 360 | + "--check_attempts", "2", |
| 361 | + "--check_path", "/testUpdate", |
| 362 | + "--check_body", "OK", |
| 363 | + "--check_passive", "False", |
| 364 | + "--delimiter",",", |
| 365 | + "--text", |
| 366 | + "--no-headers", |
| 367 | + ] |
| 368 | + ) |
| 369 | + assert result == config_id + ',80,udp,roundrobin,none,False,none,,' |
| 370 | + |
| 371 | + |
| 372 | +def test_rebuild_node_balancer_udp_configuration(nodebalancer_with_udp_config_and_node): |
| 373 | + nodebalancer_id = nodebalancer_with_udp_config_and_node[0] |
| 374 | + config_id = nodebalancer_with_udp_config_and_node[1] |
| 375 | + |
| 376 | + result = exec_test_command( |
| 377 | + BASE_CMDS["nodebalancers"] |
| 378 | + + [ |
| 379 | + "config-rebuild", |
| 380 | + nodebalancer_id, |
| 381 | + config_id, |
| 382 | + "--port", "80", |
| 383 | + "--protocol", "udp", |
| 384 | + "--algorithm", "ring_hash", |
| 385 | + "--nodes.label", "defaultnode1", |
| 386 | + "--nodes.address", nodebalancer_with_udp_config_and_node[3] + ":80", |
| 387 | + "--nodes.weight", "50", |
| 388 | + "--delimiter", ",", |
| 389 | + "--text", |
| 390 | + "--no-headers", |
| 391 | + ] |
| 392 | + ) |
| 393 | + assert result == config_id + ',80,udp,ring_hash,session,False,none,,' |
| 394 | + |
| 395 | + |
| 396 | +def test_list_node_balancer_configurations_with_udp_type(nodebalancer_with_udp_config_and_node): |
| 397 | + nodebalancer_id = nodebalancer_with_udp_config_and_node[0] |
| 398 | + config_id = nodebalancer_with_udp_config_and_node[1] |
| 399 | + |
| 400 | + result = exec_test_command( |
| 401 | + BASE_CMDS["nodebalancers"] |
| 402 | + + [ |
| 403 | + "configs-list", |
| 404 | + nodebalancer_id, |
| 405 | + "--delimiter", ",", |
| 406 | + "--text", |
| 407 | + "--no-headers", |
| 408 | + ] |
| 409 | + ) |
| 410 | + assert result == config_id + ',80,udp,roundrobin,session,False,none,,' |
| 411 | + |
| 412 | + |
| 413 | +def test_view_node_balancer_udp_configuration(nodebalancer_with_udp_config_and_node): |
| 414 | + nodebalancer_id = nodebalancer_with_udp_config_and_node[0] |
| 415 | + config_id = nodebalancer_with_udp_config_and_node[1] |
| 416 | + |
| 417 | + result = exec_test_command( |
| 418 | + BASE_CMDS["nodebalancers"] |
| 419 | + + [ |
| 420 | + "config-view", |
| 421 | + nodebalancer_id, |
| 422 | + config_id, |
| 423 | + "--delimiter", ",", |
| 424 | + "--text", |
| 425 | + "--no-headers", |
| 426 | + ] |
| 427 | + ) |
| 428 | + assert result == config_id + ',80,udp,roundrobin,session,False,none,,' |
| 429 | + |
| 430 | + |
| 431 | +def test_update_node_for_node_balancer_udp_configuration(nodebalancer_with_udp_config_and_node): |
| 432 | + nodebalancer_id = nodebalancer_with_udp_config_and_node[0] |
| 433 | + config_id = nodebalancer_with_udp_config_and_node[1] |
| 434 | + node_id = nodebalancer_with_udp_config_and_node[2] |
| 435 | + |
| 436 | + result = exec_test_command( |
| 437 | + BASE_CMDS["nodebalancers"] |
| 438 | + + [ |
| 439 | + "node-update", |
| 440 | + nodebalancer_id, |
| 441 | + config_id, |
| 442 | + node_id, |
| 443 | + "--weight", "30", |
| 444 | + "--delimiter", ",", |
| 445 | + "--text", |
| 446 | + "--no-headers", |
| 447 | + ] |
| 448 | + ) |
| 449 | + assert result == node_id + ',defaultnode1,' + nodebalancer_with_udp_config_and_node[3] + ':80,Unknown,30,none' |
| 450 | + |
| 451 | + |
| 452 | +def test_list_nodes_for_node_balancer_udp_configuration(nodebalancer_with_udp_config_and_node): |
| 453 | + nodebalancer_id = nodebalancer_with_udp_config_and_node[0] |
| 454 | + config_id = nodebalancer_with_udp_config_and_node[1] |
| 455 | + node_id = nodebalancer_with_udp_config_and_node[2] |
| 456 | + |
| 457 | + result = exec_test_command( |
| 458 | + BASE_CMDS["nodebalancers"] |
| 459 | + + [ |
| 460 | + "nodes-list", |
| 461 | + nodebalancer_id, |
| 462 | + config_id, |
| 463 | + "--delimiter", ",", |
| 464 | + "--text", |
| 465 | + "--no-headers", |
| 466 | + ] |
| 467 | + ) |
| 468 | + assert result == node_id + ',defaultnode1,' + nodebalancer_with_udp_config_and_node[3] + ':80,Unknown,100,none' |
| 469 | + |
| 470 | + |
| 471 | +def test_view_node_for_node_balancer_udp_configuration(nodebalancer_with_udp_config_and_node): |
| 472 | + nodebalancer_id = nodebalancer_with_udp_config_and_node[0] |
| 473 | + config_id = nodebalancer_with_udp_config_and_node[1] |
| 474 | + node_id = nodebalancer_with_udp_config_and_node[2] |
| 475 | + |
| 476 | + result = exec_test_command( |
| 477 | + BASE_CMDS["nodebalancers"] |
| 478 | + + [ |
| 479 | + "node-view", |
| 480 | + nodebalancer_id, |
| 481 | + config_id, |
| 482 | + node_id, |
| 483 | + "--delimiter", ",", |
| 484 | + "--text", |
| 485 | + "--no-headers", |
| 486 | + ] |
| 487 | + ) |
| 488 | + assert result == node_id + ',defaultnode1,' + nodebalancer_with_udp_config_and_node[3] + ':80,Unknown,100,none' |
| 489 | + |
| 490 | + |
343 | 491 | def nodebalancer_created(): |
344 | 492 | return "[0-9]+,balancer[0-9]+,us-ord,[0-9]+-[0-9]+-[0-9]+-[0-9]+.ip.linodeusercontent.com,0" |
0 commit comments