SXP: Add tests for binding origins CRUD operations
[integration/test.git] / csit / suites / sxp / binding-origin / 010_Binding_Origins_Configuration.robot
1 *** Settings ***
2 Documentation     Test suite to verify binding origins configuration possibilities (CRUD)
3 Suite Setup       RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
4 Suite Teardown    RequestsLibrary.Delete All Sessions
5 Test Setup        SxpBindingOriginsLib.Revert To Default Binding Origins Configuration
6 Library           RequestsLibrary
7 Resource          ../../../libraries/SxpBindingOriginsLib.robot
8
9 *** Variables ***
10 @{DEFAULT_ORIGINS}    LOCAL    NETWORK
11 @{CLUSTER}        CLUSTER
12 @{DEFAULT_AND_CLUSTER}    LOCAL    NETWORK    CLUSTER
13
14 *** Test Cases ***
15 Test Add Binding Origin
16     [Documentation]    Test if binding origin is added to configuration
17     [Tags]    Binding Origins CRUD    SXP
18     SxpBindingOriginsLib.Add Binding Origin    CLUSTER    0
19     SxpBindingOriginsLib.Should Contain Binding Origins    @{DEFAULT_AND_CLUSTER}
20
21 Test Add Binding Origin With Already Used Origin Type
22     [Documentation]    Test if binding origin with already used origin type cannot be added to configuration
23     [Tags]    Binding Origins CRUD    SXP
24     BuiltIn.Run Keyword And Expect Error    RPC result is False    SxpBindingOriginsLib.Add Binding Origin    LOCAL    0
25
26 Test Add Binding Origin With Already Used Priority
27     [Documentation]    Test if binding origin with already used priotity cannot be added to configuration
28     [Tags]    Binding Origins CRUD    SXP
29     BuiltIn.Run Keyword And Expect Error    RPC result is False    SxpBindingOriginsLib.Add Binding Origin    CLUSTER    1
30
31 Test Update Binding Origin
32     [Documentation]    Test if binding origin is updated in configuration
33     [Tags]    Binding Origins CRUD    SXP
34     BuiltIn.Comment    Update default origin
35     SxpBindingOriginsLib.Update Binding Origin    LOCAL    0
36     BuiltIn.Comment    Verify that LOCAL origin priority is updated
37     SxpBindingOriginsLib.Should Contain Binding Origin With Priority    LOCAL    0
38
39 Test Update Binding Origin Of Unknown Origin Type
40     [Documentation]    Test if unknown origin cannot be updated
41     [Tags]    Binding Origins CRUD    SXP
42     BuiltIn.Run Keyword And Expect Error    RPC result is False    SxpBindingOriginsLib.Update Binding Origin    CLUSTER    0
43
44 Test Update Binding Origin With Already Used Priority
45     [Documentation]    Test if binding origin cannot be updated to use priority of another binding origin
46     [Tags]    Binding Origins CRUD    SXP
47     BuiltIn.Run Keyword And Expect Error    RPC result is False    SxpBindingOriginsLib.Update Binding Origin    LOCAL    2
48
49 Test Delete Binding Origin
50     [Documentation]    Test if binding origin is deleted from configuration
51     [Tags]    Binding Origins CRUD    SXP
52     BuiltIn.Comment    Add CLUSTER origin and verify it is added
53     SxpBindingOriginsLib.Add Binding Origin    CLUSTER    0
54     SxpBindingOriginsLib.Should Contain Binding Origins    @{DEFAULT_AND_CLUSTER}
55     BuiltIn.Comment    Delete CLUSTER origin
56     SxpBindingOriginsLib.Delete Binding Origin    CLUSTER
57     BuiltIn.Comment    Verify that CLUSTER origin is no more present
58     SxpBindingOriginsLib.Should Not Contain Binding Origins    CLUSTER
59
60 Test Delete Default Binding Origin
61     [Documentation]    Test that default binding origin cannot be deleted from configuration
62     [Tags]    Binding Origins CRUD    SXP
63     BuiltIn.Comment    Try to delete default origin
64     BuiltIn.Run Keyword And Expect Error    RPC result is False    SxpBindingOriginsLib.Delete Binding Origin    LOCAL
65     BuiltIn.Comment    Verify all default origins are preserved
66     SxpBindingOriginsLib.Should Contain Binding Origins    @{DEFAULT_ORIGINS}