aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/aai/network.robot
blob: 6bda4e27476781e50273800e41e2425f827f6923 (plain)
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
*** Settings ***
Documentation   Validate A&AI Serivce Instance
...
...               Validate A&AI Serivce Instance

Resource          aai_interface.robot
Library    Collections
Library    OperatingSystem
Library    RequestsLibrary
Library    JSONUtils
Library    HttpLibrary.HTTP

Resource          ../json_templater.robot

*** Variables ***
${INDEX PATH}     /aai/v11
${GENERIC_QUERY_PATH}  /search/generic-query?
${SYSTEM USER}    robot-ete
${CUSTOMER SPEC PATH}    /business/customers/customer/
${SERVICE SUBSCRIPTIONS}    /service-subscriptions/service-subscription/
${SERVICE INSTANCE}    /service-instances?service-instance-name=
${SERVCE INSTANCE TEMPLATE}    robot/assets/templates/aai/service_subscription.template

*** Keywords ***
Validate Network
    [Documentation]    Query and Validates A&AI Service Instance
    [Arguments]    ${service_instance_name}    ${service_type}  ${customer_id}
  ${resp}=    Run A&AI Get Request      ${INDEX PATH}${CUSTOMER SPEC PATH}${CUSTOMER ID}${SERVICE SUBSCRIPTIONS}${service_type}${SERVICE INSTANCE}${service_instance_name}
    Dictionary Should Contain Value ${resp.json()['service-instance'][0]}    ${service_instance_name}



*** Keywords ***
Create Network
    [Documentation]    Query and Validates A&AI Service Instance
    [Arguments]    ${CUSTOMER ID}
    ${json_string}=    Catenate     { "service-type": "VDNS" , "service-subscriptions":[{"service-instance-id":"instanceid123","service-instance-name":"VDNS"}]}
  ${put_resp}=    Run A&AI Put Request     ${INDEX PATH}${CUSTOMER SPEC PATH}${CUSTOMER ID}${SERVICE SUBSCRIPTIONS}/VDNS    ${json_string}
    Should Be Equal As Strings  ${put_resp.status_code}   201
  [Return]  ${put_resp.status_code}
">.getProperties()); assertNull(p.getProperty("anything")); p.setProperty("prop", "value"); assertEquals(p.getProperty("prop"), "value"); p.setProperty(Config.CADI_KEYFILE, "value"); assertEquals(p.getProperty("prop"), "value"); p.setLogLevel(Level.INFO); assertTrue(p.willLog(Level.INFO)); p.log(Level.DEBUG, new Object()); String[] args = {"key=value","wow=wow"}; p = new PropAccess(args); } @Test public void testPropAccessone() throws IOException { PropAccess p = new PropAccess(new Object()); assertNotNull(p); assertNotNull(p.getProperties()); assertNull(p.getProperty("everything")); p.setProperty("prop1", "value1"); assertEquals(p.getProperty("prop1"), "value1"); p.setProperty(Config.CADI_KEYFILE, "value1"); assertEquals(p.getProperty("prop1"), "value1"); p.setLogLevel(Level.INFO); assertTrue(p.willLog(Level.INFO)); p.log(Level.DEBUG, new Object()); String[] args = {"key=value1","wow=wow1"}; p = new PropAccess(args); } @Test public void testPropAccesstwo() throws IOException { PropAccess p = new PropAccess(new Object()); assertNotNull(p); assertNotNull(p.getProperties()); assertNull(p.getProperty("everythingone")); p.setProperty("prop12", "value12"); assertEquals(p.getProperty("prop12"), "value12"); p.setProperty(Config.CADI_KEYFILE, "value12"); assertEquals(p.getProperty("prop12"), "value12"); p.setLogLevel(Level.INFO); assertTrue(p.willLog(Level.INFO)); p.log(Level.DEBUG, new Object()); String[] args = {"key=value12","wow=wow12"}; p = new PropAccess(args); } }