- name: OpenReferenceInstances1
  description: OpenReferenceInstances request with default parameters returns instances
  pywbem_request:
    url: http://acme.com:80
    creds:
    - username
    - password
    namespace: root/cimv2
    timeout: 10
    debug: true
    operation:
      pywbem_method: OpenReferenceInstances
      FilterQuery: null
      FilterQueryLanguage: null
      OperationTimeout: null
      ResultClass: null
      PropertyList: null
      IncludeClassOrigin: null
      ContinueOnError: null
      Role: null
      MaxObjectCount: 100
      InstanceName:
        pywbem_object: CIMInstanceName
        classname: PyWBEM_Person
        namespace: root/cimv2
        keybindings:
          CreationClassName: PyWBEM_Person
          Name: Alice
  pywbem_response:
    pullresult:
        context:
            - '500054'
            - root/cimv2
        eos: False
        instances:
            -
                pywbem_object: CIMInstance
                classname: PyWBEM_MemberOfPersonCollection
                properties:
                  member:
                    pywbem_object: CIMProperty
                    name: Member
                    value:
                      pywbem_object: CIMInstanceName
                      classname: PyWBEM_Person
                      namespace: null
                      keybindings:
                        CreationClassName: PyWBEM_Person
                        Name: Alice
                    type: reference
                    reference_class: CIM_ManagedElement
                    embedded_object: null
                    is_array: false
                    array_size: null
                    class_origin: null
                    propagated: false
                    qualifiers: {}
                  collection:
                    pywbem_object: CIMProperty
                    name: Collection
                    value:
                      pywbem_object: CIMInstanceName
                      classname: PyWBEM_PersonCollection
                      namespace: null
                      keybindings:
                        instanceid: PersonCollection
                    type: reference
                    reference_class: CIM_Collection
                    embedded_object: null
                    is_array: false
                    array_size: null
                    class_origin: null
                    propagated: false
                    qualifiers: {}
                path:
                  pywbem_object: CIMInstanceName
                  classname: PyWBEM_MemberOfPersonCollection
                  host: sheldon
                  namespace: root/cimv2
                  keybindings:
                    member:
                      pywbem_object: CIMInstanceName
                      classname: PyWBEM_Person
                      namespace: null
                      keybindings:
                        CreationClassName: PyWBEM_Person
                        Name: Alice
                    collection:
                      pywbem_object: CIMInstanceName
                      classname: PyWBEM_PersonCollection
                      namespace: null
                      keybindings:
                        instanceid: PersonCollection
  http_request:
    verb: POST
    url: http://acme.com:80/cimom
    headers:
      CIMOperation: MethodCall
      CIMMethod: OpenReferenceInstances
      CIMObject: root/cimv2
    data: '<?xml version="1.0" encoding="utf-8" ?>
      <CIM CIMVERSION="2.0" DTDVERSION="2.0">
      <MESSAGE ID="1001" PROTOCOLVERSION="1.0">
      <SIMPLEREQ>
      <IMETHODCALL NAME="OpenReferenceInstances">
      <LOCALNAMESPACEPATH>
      <NAMESPACE NAME="root"/>
      <NAMESPACE NAME="cimv2"/>
      </LOCALNAMESPACEPATH>
      <IPARAMVALUE NAME="InstanceName">
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </IPARAMVALUE>
      <IPARAMVALUE NAME="MaxObjectCount">
      <VALUE>100</VALUE>
      </IPARAMVALUE>
      </IMETHODCALL>
      </SIMPLEREQ>
      </MESSAGE>
      </CIM>'
  http_response:
    status: 200
    headers:
      cimoperation: MethodResponse
    data: '<?xml version="1.0" encoding="utf-8" ?>
      <CIM CIMVERSION="2.0" DTDVERSION="2.0">
      <MESSAGE ID="1001" PROTOCOLVERSION="1.0">
      <SIMPLERSP>
      <IMETHODRESPONSE NAME="OpenReferenceInstances">
      <IRETURNVALUE>
      <VALUE.INSTANCEWITHPATH>
      <INSTANCEPATH>
      <NAMESPACEPATH>
      <HOST>sheldon</HOST>
      <LOCALNAMESPACEPATH>
      <NAMESPACE NAME="root"/>
      <NAMESPACE NAME="cimv2"/>
      </LOCALNAMESPACEPATH>
      </NAMESPACEPATH>
      <INSTANCENAME CLASSNAME="PyWBEM_MemberOfPersonCollection">
      <KEYBINDING NAME="Collection">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_PersonCollection">
      <KEYBINDING NAME="InstanceID">
      <KEYVALUE VALUETYPE="string" TYPE="string">PersonCollection</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </KEYBINDING>
      <KEYBINDING NAME="Member">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </KEYBINDING>
      </INSTANCENAME>
      </INSTANCEPATH>
      <INSTANCE CLASSNAME="PyWBEM_MemberOfPersonCollection" >
      <PROPERTY.REFERENCE NAME="Collection"  REFERENCECLASS="CIM_Collection">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_PersonCollection">
      <KEYBINDING NAME="InstanceID">
      <KEYVALUE VALUETYPE="string" TYPE="string">PersonCollection</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </PROPERTY.REFERENCE>
      <PROPERTY.REFERENCE NAME="Member"  REFERENCECLASS="CIM_ManagedElement">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </PROPERTY.REFERENCE>
      </INSTANCE>
      </VALUE.INSTANCEWITHPATH>
      </IRETURNVALUE>
      <PARAMVALUE NAME="EndOfSequence">
      <VALUE>FALSE</VALUE>
      </PARAMVALUE>
      <PARAMVALUE NAME="EnumerationContext">
      <VALUE>500054</VALUE>
      </PARAMVALUE>
      </IMETHODRESPONSE>
      </SIMPLERSP>
      </MESSAGE>
      </CIM>'

# TODO: add error tests.

- name: OpenReferenceInstancesError1
  description: OpenReferenceInstances fails with CIMXMLParserError (CIMX)
  pywbem_request:
    url: http://acme.com:80
    creds:
    - username
    - password
    namespace: root/cimv2
    timeout: 10
    debug: true
    operation:
      pywbem_method: OpenReferenceInstances
      FilterQuery: null
      FilterQueryLanguage: null
      OperationTimeout: null
      ResultClass: null
      PropertyList: null
      IncludeClassOrigin: null
      ContinueOnError: null
      Role: null
      MaxObjectCount: 100
      InstanceName:
        pywbem_object: CIMInstanceName
        classname: PyWBEM_Person
        namespace: root/cimv2
        keybindings:
          CreationClassName: PyWBEM_Person
          Name: Alice
  pywbem_response:
    exception: CIMXMLParseError
  http_request:
    verb: POST
    url: http://acme.com:80/cimom
    headers:
      CIMOperation: MethodCall
      CIMMethod: OpenReferenceInstances
      CIMObject: root/cimv2
    data: '<?xml version="1.0" encoding="utf-8" ?>
      <CIM CIMVERSION="2.0" DTDVERSION="2.0">
      <MESSAGE ID="1001" PROTOCOLVERSION="1.0">
      <SIMPLEREQ>
      <IMETHODCALL NAME="OpenReferenceInstances">
      <LOCALNAMESPACEPATH>
      <NAMESPACE NAME="root"/>
      <NAMESPACE NAME="cimv2"/>
      </LOCALNAMESPACEPATH>
      <IPARAMVALUE NAME="InstanceName">
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </IPARAMVALUE>
      <IPARAMVALUE NAME="MaxObjectCount">
      <VALUE>100</VALUE>
      </IPARAMVALUE>
      </IMETHODCALL>
      </SIMPLEREQ>
      </MESSAGE>
      </CIM>'
  http_response:
    status: 200
    headers:
      cimoperation: MethodResponse
    data: '<?xml version="1.0" encoding="utf-8" ?>
      <CIMX CIMVERSION="2.0" DTDVERSION="2.0">
      <MESSAGE ID="1001" PROTOCOLVERSION="1.0">
      <SIMPLERSP>
      <IMETHODRESPONSE NAME="OpenReferenceInstances">
      <IRETURNVALUE>
      <VALUE.INSTANCEWITHPATH>
      <INSTANCEPATH>
      <NAMESPACEPATH>
      <HOST>sheldon</HOST>
      <LOCALNAMESPACEPATH>
      <NAMESPACE NAME="root"/>
      <NAMESPACE NAME="cimv2"/>
      </LOCALNAMESPACEPATH>
      </NAMESPACEPATH>
      <INSTANCENAME CLASSNAME="PyWBEM_MemberOfPersonCollection">
      <KEYBINDING NAME="Collection">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_PersonCollection">
      <KEYBINDING NAME="InstanceID">
      <KEYVALUE VALUETYPE="string" TYPE="string">PersonCollection</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </KEYBINDING>
      <KEYBINDING NAME="Member">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </KEYBINDING>
      </INSTANCENAME>
      </INSTANCEPATH>
      <INSTANCE CLASSNAME="PyWBEM_MemberOfPersonCollection" >
      <PROPERTY.REFERENCE NAME="Collection"  REFERENCECLASS="CIM_Collection">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_PersonCollection">
      <KEYBINDING NAME="InstanceID">
      <KEYVALUE VALUETYPE="string" TYPE="string">PersonCollection</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </PROPERTY.REFERENCE>
      <PROPERTY.REFERENCE NAME="Member"  REFERENCECLASS="CIM_ManagedElement">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </PROPERTY.REFERENCE>
      </INSTANCE>
      </VALUE.INSTANCEWITHPATH>
      </IRETURNVALUE>
      <PARAMVALUE NAME="EndOfSequence">
      <VALUE>FALSE</VALUE>
      </PARAMVALUE>
      <PARAMVALUE NAME="EnumerationContext">
      <VALUE>500054</VALUE>
      </PARAMVALUE>
      </IMETHODRESPONSE>
      </SIMPLERSP>
      </MESSAGE>
      </CIMX>'

- name: OpenReferenceInstancesNS1
  description: OpenReferenceInstances, with leading/trailing slashes in default namespace
  pywbem_request:
    url: http://acme.com:80
    creds:
    - username
    - password
    namespace: //root/mycim//
    timeout: 10
    debug: true
    operation:
      pywbem_method: OpenReferenceInstances
      MaxObjectCount: 100
      InstanceName:
        pywbem_object: CIMInstanceName
        classname: PyWBEM_Person
        namespace: null
        keybindings:
          CreationClassName: PyWBEM_Person
          Name: Alice
  pywbem_response:
    pullresult:
        context:
            - '500054'
            - root/mycim
        eos: False
        instances:
            -   pywbem_object: CIMInstance
                classname: PyWBEM_MemberOfPersonCollection
                properties: []
                path:
                  pywbem_object: CIMInstanceName
                  classname: PyWBEM_MemberOfPersonCollection
                  host: acme.com:80
                  namespace: root/mycim
                  keybindings:
                    member:
                      pywbem_object: CIMInstanceName
                      classname: PyWBEM_Person
                      namespace: null
                      keybindings:
                        CreationClassName: PyWBEM_Person
                        Name: Alice
                    collection:
                      pywbem_object: CIMInstanceName
                      classname: PyWBEM_PersonCollection
                      namespace: null
                      keybindings:
                        instanceid: PersonCollection
  http_request:
    verb: POST
    url: http://acme.com:80/cimom
    headers:
      CIMOperation: MethodCall
      CIMMethod: OpenReferenceInstances
      CIMObject: root/mycim
    data: '<?xml version="1.0" encoding="utf-8" ?>
      <CIM CIMVERSION="2.0" DTDVERSION="2.0">
      <MESSAGE ID="1001" PROTOCOLVERSION="1.0">
      <SIMPLEREQ>
      <IMETHODCALL NAME="OpenReferenceInstances">
      <LOCALNAMESPACEPATH>
      <NAMESPACE NAME="root"/>
      <NAMESPACE NAME="mycim"/>
      </LOCALNAMESPACEPATH>
      <IPARAMVALUE NAME="InstanceName">
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </IPARAMVALUE>
      <IPARAMVALUE NAME="MaxObjectCount">
      <VALUE>100</VALUE>
      </IPARAMVALUE>
      </IMETHODCALL>
      </SIMPLEREQ>
      </MESSAGE>
      </CIM>'
  http_response:
    status: 200
    headers:
      cimoperation: MethodResponse
    data: '<?xml version="1.0" encoding="utf-8" ?>
      <CIM CIMVERSION="2.0" DTDVERSION="2.0">
      <MESSAGE ID="1001" PROTOCOLVERSION="1.0">
      <SIMPLERSP>
      <IMETHODRESPONSE NAME="OpenReferenceInstances">
      <IRETURNVALUE>
      <VALUE.INSTANCEWITHPATH>
      <INSTANCEPATH>
      <NAMESPACEPATH>
      <HOST>acme.com:80</HOST>
      <LOCALNAMESPACEPATH>
      <NAMESPACE NAME="root"/>
      <NAMESPACE NAME="mycim"/>
      </LOCALNAMESPACEPATH>
      </NAMESPACEPATH>
      <INSTANCENAME CLASSNAME="PyWBEM_MemberOfPersonCollection">
      <KEYBINDING NAME="Collection">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_PersonCollection">
      <KEYBINDING NAME="InstanceID">
      <KEYVALUE VALUETYPE="string" TYPE="string">PersonCollection</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </KEYBINDING>
      <KEYBINDING NAME="Member">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </KEYBINDING>
      </INSTANCENAME>
      </INSTANCEPATH>
      <INSTANCE CLASSNAME="PyWBEM_MemberOfPersonCollection" >
      </INSTANCE>
      </VALUE.INSTANCEWITHPATH>
      </IRETURNVALUE>
      <PARAMVALUE NAME="EndOfSequence">
      <VALUE>FALSE</VALUE>
      </PARAMVALUE>
      <PARAMVALUE NAME="EnumerationContext">
      <VALUE>500054</VALUE>
      </PARAMVALUE>
      </IMETHODRESPONSE>
      </SIMPLERSP>
      </MESSAGE>
      </CIM>'

- name: OpenReferenceInstancesNS2
  description: OpenReferenceInstances, with leading/trailing slashes in object namespace
  pywbem_request:
    url: http://acme.com:80
    creds:
    - username
    - password
    namespace: null
    timeout: 10
    debug: true
    operation:
      pywbem_method: OpenReferenceInstances
      MaxObjectCount: 100
      InstanceName:
        pywbem_object: CIMInstanceName
        classname: PyWBEM_Person
        namespace: //root/mycim//
        keybindings:
          CreationClassName: PyWBEM_Person
          Name: Alice
  pywbem_response:
    pullresult:
        context:
            - '500054'
            - root/mycim
        eos: False
        instances:
            -   pywbem_object: CIMInstance
                classname: PyWBEM_MemberOfPersonCollection
                properties: []
                path:
                  pywbem_object: CIMInstanceName
                  classname: PyWBEM_MemberOfPersonCollection
                  host: acme.com:80
                  namespace: root/mycim
                  keybindings:
                    member:
                      pywbem_object: CIMInstanceName
                      classname: PyWBEM_Person
                      namespace: null
                      keybindings:
                        CreationClassName: PyWBEM_Person
                        Name: Alice
                    collection:
                      pywbem_object: CIMInstanceName
                      classname: PyWBEM_PersonCollection
                      namespace: null
                      keybindings:
                        instanceid: PersonCollection
  http_request:
    verb: POST
    url: http://acme.com:80/cimom
    headers:
      CIMOperation: MethodCall
      CIMMethod: OpenReferenceInstances
      CIMObject: root/mycim
    data: '<?xml version="1.0" encoding="utf-8" ?>
      <CIM CIMVERSION="2.0" DTDVERSION="2.0">
      <MESSAGE ID="1001" PROTOCOLVERSION="1.0">
      <SIMPLEREQ>
      <IMETHODCALL NAME="OpenReferenceInstances">
      <LOCALNAMESPACEPATH>
      <NAMESPACE NAME="root"/>
      <NAMESPACE NAME="mycim"/>
      </LOCALNAMESPACEPATH>
      <IPARAMVALUE NAME="InstanceName">
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </IPARAMVALUE>
      <IPARAMVALUE NAME="MaxObjectCount">
      <VALUE>100</VALUE>
      </IPARAMVALUE>
      </IMETHODCALL>
      </SIMPLEREQ>
      </MESSAGE>
      </CIM>'
  http_response:
    status: 200
    headers:
      cimoperation: MethodResponse
    data: '<?xml version="1.0" encoding="utf-8" ?>
      <CIM CIMVERSION="2.0" DTDVERSION="2.0">
      <MESSAGE ID="1001" PROTOCOLVERSION="1.0">
      <SIMPLERSP>
      <IMETHODRESPONSE NAME="OpenReferenceInstances">
      <IRETURNVALUE>
      <VALUE.INSTANCEWITHPATH>
      <INSTANCEPATH>
      <NAMESPACEPATH>
      <HOST>acme.com:80</HOST>
      <LOCALNAMESPACEPATH>
      <NAMESPACE NAME="root"/>
      <NAMESPACE NAME="mycim"/>
      </LOCALNAMESPACEPATH>
      </NAMESPACEPATH>
      <INSTANCENAME CLASSNAME="PyWBEM_MemberOfPersonCollection">
      <KEYBINDING NAME="Collection">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_PersonCollection">
      <KEYBINDING NAME="InstanceID">
      <KEYVALUE VALUETYPE="string" TYPE="string">PersonCollection</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </KEYBINDING>
      <KEYBINDING NAME="Member">
      <VALUE.REFERENCE>
      <INSTANCENAME CLASSNAME="PyWBEM_Person">
      <KEYBINDING NAME="CreationClassName">
      <KEYVALUE VALUETYPE="string" TYPE="string">PyWBEM_Person</KEYVALUE>
      </KEYBINDING>
      <KEYBINDING NAME="Name">
      <KEYVALUE VALUETYPE="string" TYPE="string">Alice</KEYVALUE>
      </KEYBINDING>
      </INSTANCENAME>
      </VALUE.REFERENCE>
      </KEYBINDING>
      </INSTANCENAME>
      </INSTANCEPATH>
      <INSTANCE CLASSNAME="PyWBEM_MemberOfPersonCollection" >
      </INSTANCE>
      </VALUE.INSTANCEWITHPATH>
      </IRETURNVALUE>
      <PARAMVALUE NAME="EndOfSequence">
      <VALUE>FALSE</VALUE>
      </PARAMVALUE>
      <PARAMVALUE NAME="EnumerationContext">
      <VALUE>500054</VALUE>
      </PARAMVALUE>
      </IMETHODRESPONSE>
      </SIMPLERSP>
      </MESSAGE>
      </CIM>'
