TT#56467 - Fixes for Test Framework

* change threads number to 2 as
	   it temporarily fixes the 403 error
	   for the first two test cases
	 * add creating of contract in test
	   case SubscriberRegistration because
	   fetchig an existing one would fail

Change-Id: I5f27c01f39f8611004618feebc9ed1b6a7ee8066
changes/56/33056/4
Flaviu Mates 6 years ago
parent 42473db9d7
commit a4d7fa7a91

@ -38,26 +38,68 @@
ok:
'${domain}.id': defined
#get a customer for testing
#create a BillingProfile
-
name: get a customer for testing
name: create a BillingProfile
type: item
method: GET
path: '/api/customers/?page=1&rows=1&order_by=id&order_by_direction=desc'
method: POST
path: /api/billingprofiles/
header:
Content-Type: application/json
Prefer: return=representation
content:
name: test profile ${unique_id}
handle: test_profile_handle${unique_id}
reseller_id: 1
conditions:
is:
code: 201
retain:
customer: body
billing_profile_id: header.location
#create a Customer Contact
-
name: create a Customer Contact
type: item
method: POST
path: /api/customercontacts/
header:
Content-Type: application/json
content:
firstname: cust_contact_first
lastname: cust_contact_last
email: cust_contact@custcontact.invalid
reseller_id: 1
conditions:
is:
code: 201
perl_code: !!perl/code |
{
my ($retained) = @_;
my $customer = $retained->{customer}->{'_embedded'}->{'ngcp:customers'}->[0];
$retained->{customer} = $customer;
$retained->{customer_id} = $customer->{id};
$retained->{customer_type} = 'sipaccount';
}
retain:
customer_contact_path: header.location
customer_contact_id: header.location
#create Customer
-
name: include create Customer
type: include
file: CreateCustomer.yaml
perl_code: !!perl/code |
{
my ($retained) = @_;
$retained->{customer_content} = {
status => 'active',
contact_id => $retained->{customer_contact_id},
billing_profile_id => $retained->{billing_profile_id},
type => 'sipaccount',
max_subscribers => undef,
external_id => undef
};
}
conditions:
is:
code: 200
ok:
'${customer}.id': defined
#get a subscriberprofile for testing
-
@ -73,6 +115,7 @@
my $subscriberprofile = $retained->{subscriberprofile}->{'_embedded'}->{'ngcp:subscriberprofiles'}->[0];
$retained->{subscriberprofile} = $subscriberprofile;
$retained->{subscriberprofile_id} = $subscriberprofile->{id};
$retained->{customer_id} = $retained->{customer}->{id};
}
conditions:
is:

@ -53,7 +53,7 @@ for ( @test_files ) {
$tests_queue->end();
for (1..4) {
for (1..2) {
push @threads, threads->create( {'context' => 'scalar'}, \&worker, $tests_queue, 0 );
}

Loading…
Cancel
Save