diff --git a/debian/control b/debian/control index 9ba8badb67..56b1e231c8 100644 --- a/debian/control +++ b/debian/control @@ -152,3 +152,22 @@ Description: tools from ngcp-panel application A completely overhauled provisioning interface for the NGCP system. . This package contains some helper tools from ngcp-panel + +Package: ngcp-api-testframework +Section: perl +Architecture: all +Depends: + ${misc:Depends}, + ${perl:Depends}, + libcpanel-json-xs-perl, + libdata-walk-perl, + libdatetime-format-iso8601-perl, + libdatetime-format-strptime-perl, + liblog-log4perl-perl, + libmoose-perl, + liburi-perl, + libwww-perl, + libyaml-libyaml-perl, +Description: TestFramework for testing NGCP API functionalities + The NGCP API Test Framework is designed to run over the API rails and test + its basic functionalities, using yaml scenarios. diff --git a/debian/ngcp-api-testframework.install b/debian/ngcp-api-testframework.install new file mode 100644 index 0000000000..ab8790bc5e --- /dev/null +++ b/debian/ngcp-api-testframework.install @@ -0,0 +1,2 @@ +usr/share/perl5/NGCP/API/TestFramework.pm +usr/share/perl5/NGCP/API/TestFramework diff --git a/debian/ngcp-panel.install b/debian/ngcp-panel.install index 5ccb146dfc..868db6e66b 100644 --- a/debian/ngcp-panel.install +++ b/debian/ngcp-panel.install @@ -8,4 +8,5 @@ share/* usr/share/ngcp-panel/ usr/share/man/man3/NGCP::* usr/share/perl5/Catalyst/Plugin/NGCP -usr/share/perl5/NGCP +usr/share/perl5/NGCP/Panel.pm +usr/share/perl5/NGCP/Panel diff --git a/t/api-rest2/lib/TestFramework.pm b/lib/NGCP/API/TestFramework.pm similarity index 93% rename from t/api-rest2/lib/TestFramework.pm rename to lib/NGCP/API/TestFramework.pm index 6142e4c734..532b3f2158 100644 --- a/t/api-rest2/lib/TestFramework.pm +++ b/lib/NGCP/API/TestFramework.pm @@ -1,4 +1,4 @@ -package TestFramework; +package NGCP::API::TestFramework; use strict; use warnings; @@ -18,9 +18,9 @@ use URI; use YAML::XS qw(LoadFile); use Data::Dumper; -use TestFramework::RequestBuilder; -use TestFramework::Client; -use TestFramework::TestExecutor; +use NGCP::API::TestFramework::RequestBuilder; +use NGCP::API::TestFramework::Client; +use NGCP::API::TestFramework::TestExecutor; has 'file_path' => ( isa => 'Str', @@ -35,15 +35,15 @@ sub run { chomp $test_case_name; Log::Log4perl->easy_init( { level => $DEBUG, file => ">>/results/$test_case_name.log", - category => "TestFramework::Client", + category => "NGCP::API::TestFramework::Client", layout => '%d - %F{1} line %L - %M: %m%n' }, { level => $DEBUG, file => ">>/results/$test_case_name.log", - category => "TestFramework::RequestBuilder", + category => "NGCP::API::TestFramework::RequestBuilder", layout => '%d - %F{1} line %L - %M: %m%n' }, { level => $DEBUG, file => ">>/results/$test_case_name.log", - category => "TestFramework::TestExecutor", + category => "NGCP::API::TestFramework::TestExecutor", layout => '%d - %F{1} line %L - %M: %m%n' }, { level => $DEBUG, file => ">/results/$test_case_name.log", @@ -65,11 +65,11 @@ sub run { INFO( "Setting up the base URI." ); my $base_uri = $ENV{CATALYST_SERVER} || ('https://'.hostfqdn.':4443'); INFO( "Setting up the RequestBuilder." ); - my $request_builder = TestFramework::RequestBuilder->new({ base_uri => $base_uri }); + my $request_builder = NGCP::API::TestFramework::RequestBuilder->new({ base_uri => $base_uri }); INFO( "Setting up the Client." ); - my $client = TestFramework::Client->new( { uri => $base_uri } ); + my $client = NGCP::API::TestFramework::Client->new( { uri => $base_uri } ); INFO( "Setting up the Test Executor." ); - my $test_executor = TestFramework::TestExecutor->new(); + my $test_executor = NGCP::API::TestFramework::TestExecutor->new(); # initializing time to add to fields which need to be unique my $retained = { unique_id => int(rand(100000)) }; diff --git a/t/api-rest2/lib/TestFramework/Client.pm b/lib/NGCP/API/TestFramework/Client.pm similarity index 99% rename from t/api-rest2/lib/TestFramework/Client.pm rename to lib/NGCP/API/TestFramework/Client.pm index 48894fcd42..6c80ce1b2f 100644 --- a/t/api-rest2/lib/TestFramework/Client.pm +++ b/lib/NGCP/API/TestFramework/Client.pm @@ -1,4 +1,4 @@ -package TestFramework::Client; +package NGCP::API::TestFramework::Client; use strict; use warnings; @@ -170,4 +170,3 @@ sub perform_request { } 1; - diff --git a/t/api-rest2/lib/TestFramework/RequestBuilder.pm b/lib/NGCP/API/TestFramework/RequestBuilder.pm similarity index 97% rename from t/api-rest2/lib/TestFramework/RequestBuilder.pm rename to lib/NGCP/API/TestFramework/RequestBuilder.pm index 76da815bbd..df45c31833 100644 --- a/t/api-rest2/lib/TestFramework/RequestBuilder.pm +++ b/lib/NGCP/API/TestFramework/RequestBuilder.pm @@ -1,4 +1,4 @@ -package TestFramework::RequestBuilder; +package NGCP::API::TestFramework::RequestBuilder; use strict; use warnings; diff --git a/t/api-rest2/lib/TestFramework/TestExecutor.pm b/lib/NGCP/API/TestFramework/TestExecutor.pm similarity index 99% rename from t/api-rest2/lib/TestFramework/TestExecutor.pm rename to lib/NGCP/API/TestFramework/TestExecutor.pm index 84df4c1d1e..128b6e339b 100644 --- a/t/api-rest2/lib/TestFramework/TestExecutor.pm +++ b/lib/NGCP/API/TestFramework/TestExecutor.pm @@ -1,4 +1,4 @@ -package TestFramework::TestExecutor; +package NGCP::API::TestFramework::TestExecutor; use strict; use warnings; diff --git a/t/api-rest2/testrunner b/t/api-rest2/testrunner index 4d0905f4e5..a91512ff82 100755 --- a/t/api-rest2/testrunner +++ b/t/api-rest2/testrunner @@ -1,9 +1,9 @@ #!/usr/bin/perl -use lib 't/api-rest2/lib'; +use lib 'lib'; use strict; use warnings; -use TestFramework; +use NGCP::API::TestFramework; use threads; use Thread::Queue; use Data::Dumper; @@ -73,7 +73,7 @@ sub worker { chomp $test_file; my $start_time = time; print "Running tests from $test_file\n"; - my $test_framework = TestFramework->new( {file_path => $test_file} ); + my $test_framework = NGCP::API::TestFramework->new( {file_path => $test_file} ); my $result = $test_framework->run();