| 622 | } |
| 623 | |
| 624 | static int |
| 625 | test_create_graph(void) |
| 626 | { |
| 627 | static const char *node_patterns_dummy[] = { |
| 628 | "test_node_source1", "test_node00", |
| 629 | "test_node00-test_node11", "test_node00-test_node22", |
| 630 | "test_node00-test_node33", "test_node00-dummy_node", |
| 631 | }; |
| 632 | struct rte_graph_param gconf = { |
| 633 | .socket_id = SOCKET_ID_ANY, |
| 634 | .nb_node_patterns = 6, |
| 635 | .node_patterns = node_patterns_dummy, |
| 636 | }; |
| 637 | uint32_t dummy_node_id; |
| 638 | uint32_t node_id; |
| 639 | |
| 640 | node_id = rte_node_from_name("test_node00"); |
| 641 | dummy_node_id = rte_node_clone(node_id, "dummy_node"); |
| 642 | if (rte_node_is_invalid(dummy_node_id)) { |
| 643 | printf("Got invalid node id\n"); |
| 644 | return -1; |
| 645 | } |
| 646 | |
| 647 | graph_id = rte_graph_create("worker0", &gconf); |
| 648 | if (graph_id != RTE_GRAPH_ID_INVALID) { |
| 649 | printf("Graph creation success with isolated node, expected graph creation fail\n"); |
| 650 | return -1; |
| 651 | } |
| 652 | |
| 653 | gconf.nb_node_patterns = 5; |
| 654 | gconf.node_patterns = node_patterns; |
| 655 | graph_id = rte_graph_create("worker0", &gconf); |
| 656 | if (graph_id == RTE_GRAPH_ID_INVALID) { |
| 657 | printf("Graph creation failed with error = %d\n", rte_errno); |
| 658 | return -1; |
| 659 | } |
| 660 | return 0; |
| 661 | } |
| 662 | |
| 663 | static int |
| 664 | test_graph_clone(void) |
nothing calls this directly
no test coverage detected