1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
require "test_helper"
require "helpers/nfv_helper"
describe "@vnf | NFV vnfs requests" do
before do
@vnfs_create = {
"status" => String,
"description" => String,
"tenant_id" => String,
"name" => String,
"instance_id" => String,
"mgmt_url" => Fog::Nullable::String,
"attributes" => Hash,
"id" => String,
"vnfd_id" => String
}
@vnfs = {
"status" => String,
"description" => String,
"tenant_id" => String,
"name" => String,
"instance_id" => String,
"mgmt_url" => Fog::Nullable::String,
"attributes" => Hash,
"id" => String
}
@nfv, @vnf_data, @auth = set_nfv_data
@vnfd_body = @nfv.create_vnfd(:vnfd => @vnfd_data, :auth => @auth).body
vnf_data = {:vnfd_id => @vnfd_body["vnfd"]["id"], :name => 'Test'}
@vnf_body = @nfv.create_vnf(:vnf => vnf_data, :auth => @auth).body
@nfv.vnfs.get(@vnf_body["vnf"]["id"]).wait_for { ready? }
end
describe "success" do
it "#create_vnfs" do
@vnf_body.must_match_schema('vnf' => @vnfs_create)
end
it "#list_vnfs" do
@nfv.list_vnfs.body.must_match_schema('vnfs' => [@vnfs])
end
it "#get_vnfs" do
@nfv.get_vnf(@vnf_body["vnf"]["id"]).body.must_match_schema('vnf' => @vnfs)
end
describe "inter2" do
it "#update_vnfs" do
vnf_data = {:attributes => {:config => "vdus:\n vdu1:<sample_vdu_config> \n\n"}}
auth = {"tenantName" => "admin", "passwordCredentials" => {"username" => "admin", "password" => "password"}}
@nfv.update_vnf(@vnf_body["vnf"]["id"], :vnf => vnf_data, :auth => auth).body.must_match_schema('vnf' => @vnfs)
end
it "#delete_vnfs" do
sleep(10) unless Fog.mocking?
@nfv.delete_vnf(@vnf_body["vnf"]["id"]).status.must_equal 204
@nfv.delete_vnfd(@vnfd_body["vnfd"]["id"]).status.must_equal 204
end
end
end
end
|