{"id":1757,"date":"2023-06-06T11:20:26","date_gmt":"2023-06-06T11:20:26","guid":{"rendered":"https:\/\/community.5gasp.eu\/?page_id=1757"},"modified":"2023-06-22T10:03:04","modified_gmt":"2023-06-22T10:03:04","slug":"5gasp-cli-for-creating-testing-descriptors-tutorial","status":"publish","type":"page","link":"https:\/\/community.5gasp.eu\/index.php\/5gasp-cli-for-creating-testing-descriptors-tutorial\/","title":{"rendered":"5GASP CLI for creating Testing Descriptors Tutorial"},"content":{"rendered":"\n<p>The 5GASP command line interface was developed to facilitate the creation of testing descriptors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a Virtual Environment<\/h2>\n\n\n\n<p>First, we recommend using a virtual environment. In this example, we will be using <a href=\"https:\/\/pypi.org\/project\/pyenv\/\"><em>pyenv<\/em><\/a>. Now, let&#8217;s create the virtual environment by running the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pyenv virtualenv 3.9.14 5gasp-cli-tutorial<\/code><\/pre>\n\n\n\n<p>Now that it was created, let&#8217;s activate it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pyenv shell 5gasp-cli-tutorial<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Installing the CLI<\/h2>\n\n\n\n<p>After activating the venv, we need to install the CLI package, for that, we will be using <a href=\"https:\/\/pypi.org\/project\/pip\/\"><em>pip<\/em><\/a> which is the package installer for Python.<\/p>\n\n\n\n<p>We simply need to type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install 5gasp-cli<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">CLI<\/h2>\n\n\n\n<p>At this moment, the CLI has three features\/commands:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>list test beds<\/li>\n\n\n\n<li>list available tests<\/li>\n\n\n\n<li>create testing descriptor<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Listing the Test Beds<\/h2>\n\n\n\n<p>Let&#8217;s dive into the first command.<\/p>\n\n\n\n<p>If we wish to see the available test beds, we can do it by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>5gasp-cli list-testbeds<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-8.png\" alt=\"\" class=\"wp-image-1758\" width=\"534\" height=\"137\"\/><\/figure>\n\n\n\n<p>As we can see, the available test beds were listed. From here, we can also see the available tests for a specific test bed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-12-1024x560.png\" alt=\"\" class=\"wp-image-1762\" width=\"539\" height=\"295\" srcset=\"https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-12-1024x560.png 1024w, https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-12-300x164.png 300w, https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-12-768x420.png 768w, https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-12-611x334.png 611w, https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-12.png 1220w\" sizes=\"auto, (max-width: 539px) 100vw, 539px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Listing the Available Tests<\/h2>\n\n\n\n<p>Another feature of the CLI is the ability to list all the available tests, as well as their parameters. We can use this feature by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>5gasp-cli list-available-tests<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a Testing Descriptor<\/h2>\n\n\n\n<p>Now, the final and most complex feature: creating a testing descriptor.<\/p>\n\n\n\n<p>We can access it by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>5gasp-cli create-testing-descriptor<\/code><\/pre>\n\n\n\n<p>This command has two options:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>output-filepath: specifies the path to the created descriptor (can be a directory or a file);<\/li>\n\n\n\n<li>infer-tags-from-nsd: one or more NSDs (Network Service Descriptors) can be passed to infer connection point tags from.<\/li>\n<\/ul>\n\n\n\n<p>In this example, we will be passing both options, although they are not required.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-13.png\" alt=\"\" class=\"wp-image-1763\" width=\"579\" height=\"390\"\/><\/figure>\n\n\n\n<p><strong>Note<\/strong>: Currently, the 5GASP CLI only supports inferring connection point tags when they refer to a VNF, CNF-related ones are not yet supported.<\/p>\n\n\n\n<p>For a connection point, there are also template tags that can be defined that shall be rendered after the deployment of the Network Application.<\/p>\n\n\n\n<p>If no NSD is passed as an option, there will be no inferred connection points, in that case, all the added test variables&#8217; parameters will have to be manually input.<\/p>\n\n\n\n<p>When creating a testing descriptor, firstly we need to specify the network application and the network service&#8217;s names, as well as the testbed in which we want to validate your Network Application.<\/p>\n\n\n\n<p>Following, this menu is presented with the available options for the creation of a testing descriptor.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-14.png\" alt=\"\" class=\"wp-image-1764\" width=\"574\" height=\"232\"\/><\/figure>\n\n\n\n<p>When adding a new test case, if the variable can be injected by the NODS. We can choose a connection point (CP) and its template to be injected.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-15.png\" alt=\"\" class=\"wp-image-1765\" width=\"571\" height=\"237\"\/><\/figure>\n\n\n\n<p>For demonstration purposes, we added two test cases, as can be seen on the picture below.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-16-1024x765.png\" alt=\"\" class=\"wp-image-1766\" width=\"572\" height=\"427\" srcset=\"https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-16-1024x765.png 1024w, https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-16-300x224.png 300w, https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-16-768x574.png 768w, https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-16-469x350.png 469w, https:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-16.png 1221w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/figure>\n\n\n\n<p>The CLI also allows us to choose if we want the defined test cases to be executed in a specific order or a random one.<\/p>\n\n\n\n<p>Finally, the created testing descriptor is presented and saved.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/community.5gasp.eu\/wp-content\/uploads\/2023\/06\/image-17.png\" alt=\"\" class=\"wp-image-1767\" width=\"351\" height=\"541\"\/><\/figure>\n\n\n\n<p>These are the current features of the 5GASP CLI, with more to come.<\/p>\n\n\n\n<p>If you want to know more, you can check the CLI\u2019s tutorial video:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"5GASP CLI Tutorial\" width=\"1019\" height=\"573\" src=\"https:\/\/www.youtube.com\/embed\/q3YdZwOFcbw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The 5GASP command line interface was developed to facilitate the creation of testing descriptors. Creating a Virtual Environment First, we recommend using a virtual environment. In this example, we will be using pyenv. Now, let&#8217;s create the virtual environment by running the following command: Now that it was created, let&#8217;s [\u2026]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"pg_page_styles":[],"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-1757","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/community.5gasp.eu\/index.php\/wp-json\/wp\/v2\/pages\/1757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/community.5gasp.eu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/community.5gasp.eu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/community.5gasp.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/community.5gasp.eu\/index.php\/wp-json\/wp\/v2\/comments?post=1757"}],"version-history":[{"count":2,"href":"https:\/\/community.5gasp.eu\/index.php\/wp-json\/wp\/v2\/pages\/1757\/revisions"}],"predecessor-version":[{"id":1823,"href":"https:\/\/community.5gasp.eu\/index.php\/wp-json\/wp\/v2\/pages\/1757\/revisions\/1823"}],"wp:attachment":[{"href":"https:\/\/community.5gasp.eu\/index.php\/wp-json\/wp\/v2\/media?parent=1757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}