Skip to content

Go fails to process filters on enum and identity leaves and leaf-lists #969

@ygorelik

Description

@ygorelik

Current Behavior

After fixing issue #968 I noticed that YDK-Go still fails to set filters on enum and identity leaves and leaf-lists. This issue appears due to insufficiency of ydk-go infrastructure to set simultaneously value and filter on leaf and leaf-list.

Steps to Reproduce

Execute the following test unit test (currently commented out):

func (suite *NETCONFOperationsTestSuite) TestDeleteLeafList() {
    runnerCreate := ysanity.Runner{}
    runnerCreate.Ytypes.BuiltInT.EnumLlist = append(runnerCreate.Ytypes.BuiltInT.EnumLlist, ysanity.YdkEnumTest_local)
    suite.CRUD.Create(&suite.Provider, &runnerCreate)

    runnerUpdate := ysanity.Runner{}
    runnerUpdate.Ytypes.BuiltInT.EnumLlist = append(runnerUpdate.Ytypes.BuiltInT.EnumLlist, yfilter.Delete)
    suite.CRUD.Update(&suite.Provider, &runnerUpdate)

    // delete again with error
    suite.CRUD.Update(&suite.Provider, &runnerUpdate)
}

The test fails with panic with YModelError:

ygorelik@bionic:~/ydk-gen/sdk/go/core/tests$ go test -run NETCONFOperationsTestSuite/TestDeleteLeafList -v
=== RUN   TestNETCONFOperationsTestSuite
=== RUN   TestNETCONFOperationsTestSuite/TestDeleteLeafList
NETCONFOperationsTestSuite: TestDeleteLeafList ...
--- FAIL: TestNETCONFOperationsTestSuite (0.49s)
    --- FAIL: TestNETCONFOperationsTestSuite/TestDeleteLeafList (0.34s)
    	suite.go:62: test panicked: YModelError: Invalid value "" in "enum-llist" element. Path: /ydktest-sanity:runner/ytypes/built-in-t/enum-llist[.='']

Logs

NETCONFOperationsTestSuite: TestDeleteLeafList ...
[2019-11-24 19:36:56.391] [ydk] [debug] Getting new modules for path 'ydk:create'
[2019-11-24 19:36:56.391] [ydk] [debug] Loading module 'ydk', revision ''
[2019-11-24 19:36:56.391] [ydk] [debug] The module 'ydk' schema has already been populated in YDK repository
[2019-11-24 19:36:56.391] [ydk] [debug] Getting new modules for path 'ydktest-sanity:runner'
[2019-11-24 19:36:56.391] [ydk] [debug] Loading module 'ydktest-sanity', revision ''
[2019-11-24 19:36:56.391] [ydk] [debug] The module 'ydktest-sanity' schema has already been populated in YDK repository
[2019-11-24 19:36:56.391] [ydk] [debug] Enabled feature 'crypto' in 'ydktest-types'
[2019-11-24 19:36:56.391] [ydk] [debug] Enabled feature 'ipv4-non-contiguous-netmasks' in 'ydktest-sanity'
[2019-11-24 19:36:56.391] [ydk] [debug] Enabled feature 'ipv6-privacy-autoconf' in 'ydktest-sanity'
[2019-11-24 19:36:56.391] [ydk] [debug] Looking to populate schemas for 'ydktest-sanity:runner'
[2019-11-24 19:36:56.391] [ydk] [debug] Getting new modules for path 'ydktest-sanity:runner'
[2019-11-24 19:36:56.391] [ydk] [debug] Loading module 'ydktest-sanity', revision ''
[2019-11-24 19:36:56.391] [ydk] [debug] The module 'ydktest-sanity' schema has already been populated in YDK repository
[2019-11-24 19:36:56.391] [ydk] [debug] Enabled feature 'crypto' in 'ydktest-types'
[2019-11-24 19:36:56.391] [ydk] [debug] Enabled feature 'ipv4-non-contiguous-netmasks' in 'ydktest-sanity'
[2019-11-24 19:36:56.391] [ydk] [debug] Enabled feature 'ipv6-privacy-autoconf' in 'ydktest-sanity'
[2019-11-24 19:36:56.391] [ydk] [debug] Creating root data node with path '/ydktest-sanity:runner'
[2019-11-24 19:36:56.391] [ydk] [debug] [Go] path.getDataNodeFromEntity: Created datanode with path 'ydktest-sanity:runner'
[2019-11-24 19:36:56.392] [ydk] [debug] [Go] Got 23 entity children
[2019-11-24 19:36:56.392] [ydk] [debug] [Go] Looking at entity child 'one'
[2019-11-24 19:36:56.392] [ydk] [debug] [Go] Looking at entity child 'two'
[2019-11-24 19:36:56.392] [ydk] [debug] [Go] Looking at entity child 'three'
[2019-11-24 19:36:56.393] [ydk] [debug] [Go] Looking at entity child 'ytypes'
[2019-11-24 19:36:56.393] [ydk] [debug] Populating schema for 'ytypes'
[2019-11-24 19:36:56.393] [ydk] [debug] Looking to populate schemas for 'ytypes'
[2019-11-24 19:36:56.393] [ydk] [debug] Getting new modules for path 'ytypes'
[2019-11-24 19:36:56.393] [ydk] [debug] Creating node 'ytypes' with value ''
[2019-11-24 19:36:56.393] [ydk] [debug] Current path: /ydktest-sanity:runner
[2019-11-24 19:36:56.393] [ydk] [debug] Top container path: ydktest-sanity:runner
[2019-11-24 19:36:56.393] [ydk] [debug] Populating schema for 'ytypes'
[2019-11-24 19:36:56.393] [ydk] [debug] Looking to populate schemas for 'ytypes'
[2019-11-24 19:36:56.393] [ydk] [debug] Getting new modules for path 'ytypes'
[2019-11-24 19:36:56.393] [ydk] [debug] Getting child schema with path 'ytypes' in /ydktest-sanity:runner
[2019-11-24 19:36:56.393] [ydk] [debug] Getting data nodes with path 'ytypes'
[2019-11-24 19:36:56.393] [ydk] [debug] Creating new data path 'ytypes' with value '' in 'runner'
[2019-11-24 19:36:56.393] [ydk] [debug] [Go] path.populateDataNode: Populating leafs in datanode with path 'ydktest-sanity:runner/ytypes'
[2019-11-24 19:36:56.393] [ydk] [debug] [Go] Got 3 entity children
[2019-11-24 19:36:56.393] [ydk] [debug] [Go] Looking at entity child 'none'
[2019-11-24 19:36:56.394] [ydk] [debug] [Go] Looking at entity child 'built-in-t'
[2019-11-24 19:36:56.394] [ydk] [debug] Populating schema for 'built-in-t'
[2019-11-24 19:36:56.394] [ydk] [debug] Looking to populate schemas for 'built-in-t'
[2019-11-24 19:36:56.394] [ydk] [debug] Getting new modules for path 'built-in-t'
[2019-11-24 19:36:56.394] [ydk] [debug] Creating node 'built-in-t' with value ''
[2019-11-24 19:36:56.394] [ydk] [debug] Current path: /ydktest-sanity:runner/ytypes
[2019-11-24 19:36:56.394] [ydk] [debug] Top container path: ydktest-sanity:runner
[2019-11-24 19:36:56.394] [ydk] [debug] Populating schema for 'built-in-t'
[2019-11-24 19:36:56.394] [ydk] [debug] Looking to populate schemas for 'built-in-t'
[2019-11-24 19:36:56.394] [ydk] [debug] Getting new modules for path 'built-in-t'
[2019-11-24 19:36:56.394] [ydk] [debug] Getting child schema with path 'built-in-t' in /ydktest-sanity:runner/ytypes
[2019-11-24 19:36:56.394] [ydk] [debug] Getting data nodes with path 'built-in-t'
[2019-11-24 19:36:56.394] [ydk] [debug] Creating new data path 'built-in-t' with value '' in 'ytypes'
[2019-11-24 19:36:56.394] [ydk] [debug] [Go] path.populateDataNode: Populating leafs in datanode with path 'ydktest-sanity:runner/ytypes/built-in-t'
[2019-11-24 19:36:56.394] [ydk] [debug] [Go] path.populateNameValues: Got leaf {enum-llist[.="local"]: }
[2019-11-24 19:36:56.394] [ydk] [debug] Populating schema for 'enum-llist[.="local"]'
[2019-11-24 19:36:56.394] [ydk] [debug] Looking to populate schemas for 'enum-llist[.="local"]'
[2019-11-24 19:36:56.394] [ydk] [debug] Getting new modules for path 'enum-llist[.="local"]'
[2019-11-24 19:36:56.394] [ydk] [debug] Creating node 'enum-llist[.="local"]' with value ''
[2019-11-24 19:36:56.394] [ydk] [debug] Current path: /ydktest-sanity:runner/ytypes/built-in-t
[2019-11-24 19:36:56.394] [ydk] [debug] Top container path: ydktest-sanity:runner
[2019-11-24 19:36:56.395] [ydk] [debug] Populating schema for 'enum-llist[.="local"]'
[2019-11-24 19:36:56.395] [ydk] [debug] Looking to populate schemas for 'enum-llist[.="local"]'
[2019-11-24 19:36:56.395] [ydk] [debug] Getting new modules for path 'enum-llist[.="local"]'
[2019-11-24 19:36:56.395] [ydk] [debug] Getting child schema with path 'enum-llist[.="local"]' in /ydktest-sanity:runner/ytypes/built-in-t
[2019-11-24 19:36:56.395] [ydk] [debug] Getting data nodes with path 'enum-llist[.="local"]'
[2019-11-24 19:36:56.395] [ydk] [debug] Creating new data path 'enum-llist[.="local"]' with value '' in 'built-in-t'
[2019-11-24 19:36:56.395] [ydk] [debug] [Go] Got 0 entity children
[2019-11-24 19:36:56.395] [ydk] [debug] [Go] 
[2019-11-24 19:36:56.395] [ydk] [debug] [Go] Looking at entity child 'derived-t'
[2019-11-24 19:36:56.395] [ydk] [debug] [Go] 
[2019-11-24 19:36:56.395] [ydk] [debug] [Go] Looking at entity child 'one-list'
[2019-11-24 19:36:56.395] [ydk] [debug] [Go] Looking at entity child 'two-list'
[2019-11-24 19:36:56.395] [ydk] [debug] [Go] Looking at entity child 'three-list'
[2019-11-24 19:36:56.395] [ydk] [debug] [Go] Looking at entity child 'inbtw-list'
[2019-11-24 19:36:56.396] [ydk] [debug] [Go] Looking at entity child 'leaf-ref'
[2019-11-24 19:36:56.396] [ydk] [debug] [Go] Looking at entity child 'not-supported-1'
[2019-11-24 19:36:56.396] [ydk] [debug] [Go] Looking at entity child 'one-read-only'
[2019-11-24 19:36:56.396] [ydk] [debug] [Go] Looking at entity child 'mtus'
[2019-11-24 19:36:56.396] [ydk] [debug] [Go] Looking at entity child 'outer'
[2019-11-24 19:36:56.397] [ydk] [debug] [Go] Looking at entity child 'runner-2'
[2019-11-24 19:36:56.397] [ydk] [debug] [Go] Looking at entity child 'ydktest-sanity-augm:one'
[2019-11-24 19:36:56.397] [ydk] [debug] [Go] 
[2019-11-24 19:36:56.397] [ydk] [debug] ydk::path::Codec: Encoding data node '/' to XML formated string
[2019-11-24 19:36:56.398] [ydk] [debug] ydk::path::Codec: Encoding data node '/ydktest-sanity:runner' to XML formated string
[2019-11-24 19:36:56.398] [ydk] [debug] Populating schema for 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Looking to populate schemas for 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Populating schema for '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity"><ytypes><built-in-t><enum-llist>local</enum-llist></built-in-t></ytypes></runner>'
[2019-11-24 19:36:56.398] [ydk] [debug] Looking to populate schemas for '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity"><ytypes><built-in-t><enum-llist>local</enum-llist></built-in-t></ytypes></runner>'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity"><ytypes><built-in-t><enum-llist>local</enum-llist></built-in-t></ytypes></runner>'
[2019-11-24 19:36:56.398] [ydk] [debug] Creating node 'entity' with value '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity"><ytypes><built-in-t><enum-llist>local</enum-llist></built-in-t></ytypes></runner>'
[2019-11-24 19:36:56.398] [ydk] [debug] Current path: /ydk:create
[2019-11-24 19:36:56.398] [ydk] [debug] Top container path: ydk:create
[2019-11-24 19:36:56.398] [ydk] [debug] Populating schema for 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Looking to populate schemas for 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting child schema with path 'entity' in /ydk:create
[2019-11-24 19:36:56.398] [ydk] [debug] Getting data nodes with path 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Creating new data path 'entity' with value '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity"><ytypes><built-in-t><enum-llist>local</enum-llist></built-in-t></ytypes></runner>' in 'create'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'ydk:create'
[2019-11-24 19:36:56.398] [ydk] [debug] Loading module 'ydk', revision ''
[2019-11-24 19:36:56.398] [ydk] [debug] The module 'ydk' schema has already been populated in YDK repository
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'ydk:read'
[2019-11-24 19:36:56.398] [ydk] [debug] Loading module 'ydk', revision ''
[2019-11-24 19:36:56.398] [ydk] [debug] The module 'ydk' schema has already been populated in YDK repository
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'ydk:update'
[2019-11-24 19:36:56.398] [ydk] [debug] Loading module 'ydk', revision ''
[2019-11-24 19:36:56.398] [ydk] [debug] The module 'ydk' schema has already been populated in YDK repository
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'ydk:delete'
[2019-11-24 19:36:56.398] [ydk] [debug] Loading module 'ydk', revision ''
[2019-11-24 19:36:56.398] [ydk] [debug] The module 'ydk' schema has already been populated in YDK repository
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'ietf-netconf:edit-config'
[2019-11-24 19:36:56.398] [ydk] [debug] Loading module 'ietf-netconf', revision ''
[2019-11-24 19:36:56.398] [ydk] [debug] The module 'ietf-netconf' schema has already been populated in YDK repository
[2019-11-24 19:36:56.398] [ydk] [debug] Populating schema for 'target/candidate'
[2019-11-24 19:36:56.398] [ydk] [debug] Looking to populate schemas for 'target/candidate'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'target/candidate'
[2019-11-24 19:36:56.398] [ydk] [debug] Creating node 'target/candidate' with value ''
[2019-11-24 19:36:56.398] [ydk] [debug] Current path: /ietf-netconf:edit-config
[2019-11-24 19:36:56.398] [ydk] [debug] Top container path: ietf-netconf:edit-config
[2019-11-24 19:36:56.398] [ydk] [debug] Populating schema for 'target'
[2019-11-24 19:36:56.398] [ydk] [debug] Looking to populate schemas for 'target'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'target'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting child schema with path 'target' in /ietf-netconf:edit-config
[2019-11-24 19:36:56.398] [ydk] [debug] Getting data nodes with path 'target'
[2019-11-24 19:36:56.398] [ydk] [debug] Creating new data path 'target' in 'edit-config'
[2019-11-24 19:36:56.398] [ydk] [debug] Creating new data path 'candidate' with value '' in 'target'
[2019-11-24 19:36:56.398] [ydk] [debug] Populating schema for 'error-option'
[2019-11-24 19:36:56.398] [ydk] [debug] Looking to populate schemas for 'error-option'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'error-option'
[2019-11-24 19:36:56.398] [ydk] [debug] Populating schema for 'rollback-on-error'
[2019-11-24 19:36:56.398] [ydk] [debug] Looking to populate schemas for 'rollback-on-error'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'rollback-on-error'
[2019-11-24 19:36:56.398] [ydk] [debug] Creating node 'error-option' with value 'rollback-on-error'
[2019-11-24 19:36:56.398] [ydk] [debug] Current path: /ietf-netconf:edit-config
[2019-11-24 19:36:56.398] [ydk] [debug] Top container path: ietf-netconf:edit-config
[2019-11-24 19:36:56.398] [ydk] [debug] Populating schema for 'error-option'
[2019-11-24 19:36:56.398] [ydk] [debug] Looking to populate schemas for 'error-option'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'error-option'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting child schema with path 'error-option' in /ietf-netconf:edit-config
[2019-11-24 19:36:56.398] [ydk] [debug] Getting data nodes with path 'error-option'
[2019-11-24 19:36:56.398] [ydk] [debug] Creating new data path 'error-option' with value 'rollback-on-error' in 'edit-config'
[2019-11-24 19:36:56.398] [ydk] [debug] Populating schema for 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Looking to populate schemas for 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting new modules for path 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] Getting child schema with path 'entity' in /ydk:create
[2019-11-24 19:36:56.398] [ydk] [debug] Getting data nodes with path 'entity'
[2019-11-24 19:36:56.398] [ydk] [debug] ydk::path::Codec: Decoding from XML formatted payload:
<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity"><ytypes><built-in-t><enum-llist>local</enum-llist></built-in-t></ytypes></runner>
[2019-11-24 19:36:56.398] [ydk] [debug] Populating new schema from payload:
<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity"><ytypes><built-in-t><enum-llist>local</enum-llist></built-in-t></ytypes></runner>
[2019-11-24 19:36:56.398] [ydk] [debug] Extracting module namespaces from XML payload
[2019-11-24 19:36:56.399] [ydk] [debug] Loading module 'ydktest-sanity', revision ''
[2019-11-24 19:36:56.399] [ydk] [debug] The module 'ydktest-sanity' schema has already been populated in YDK repository
[2019-11-24 19:36:56.399] [ydk] [debug] Enabled feature 'crypto' in 'ydktest-types'
[2019-11-24 19:36:56.399] [ydk] [debug] Enabled feature 'ipv4-non-contiguous-netmasks' in 'ydktest-sanity'
[2019-11-24 19:36:56.399] [ydk] [debug] Enabled feature 'ipv6-privacy-autoconf' in 'ydktest-sanity'
[2019-11-24 19:36:56.399] [ydk] [debug] Performing decode operation
[2019-11-24 19:36:56.399] [ydk] [debug] Adding annotation 'ietf-netconf:operation' = merge to /ydktest-sanity:runner
[2019-11-24 19:36:56.399] [ydk] [debug] ydk::path::Codec: Encoding data node '/ydktest-sanity:runner' to XML formated string
[2019-11-24 19:36:56.399] [ydk] [debug] Populating schema for 'config'
[2019-11-24 19:36:56.399] [ydk] [debug] Looking to populate schemas for 'config'
[2019-11-24 19:36:56.399] [ydk] [debug] Getting new modules for path 'config'
[2019-11-24 19:36:56.399] [ydk] [debug] Populating schema for '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
  <ytypes>
    <built-in-t>
      <enum-llist>local</enum-llist>
    </built-in-t>
  </ytypes>
</runner>
'
[2019-11-24 19:36:56.399] [ydk] [debug] Looking to populate schemas for '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
  <ytypes>
    <built-in-t>
      <enum-llist>local</enum-llist>
    </built-in-t>
  </ytypes>
</runner>
'
[2019-11-24 19:36:56.399] [ydk] [debug] Getting new modules for path '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
  <ytypes>
    <built-in-t>
      <enum-llist>local</enum-llist>
    </built-in-t>
  </ytypes>
</runner>
'
[2019-11-24 19:36:56.399] [ydk] [debug] Creating node 'config' with value '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
  <ytypes>
    <built-in-t>
      <enum-llist>local</enum-llist>
    </built-in-t>
  </ytypes>
</runner>
'
[2019-11-24 19:36:56.399] [ydk] [debug] Current path: /ietf-netconf:edit-config
[2019-11-24 19:36:56.399] [ydk] [debug] Top container path: ietf-netconf:edit-config
[2019-11-24 19:36:56.399] [ydk] [debug] Populating schema for 'config'
[2019-11-24 19:36:56.399] [ydk] [debug] Looking to populate schemas for 'config'
[2019-11-24 19:36:56.399] [ydk] [debug] Getting new modules for path 'config'
[2019-11-24 19:36:56.399] [ydk] [debug] Getting child schema with path 'config' in /ietf-netconf:edit-config
[2019-11-24 19:36:56.399] [ydk] [debug] Getting data nodes with path 'config'
[2019-11-24 19:36:56.399] [ydk] [debug] Creating new data path 'config' with value '<runner xmlns="http://cisco.com/ns/yang/ydktest-sanity" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
  <ytypes>
    <built-in-t>
      <enum-llist>local</enum-llist>
    </built-in-t>
  </ytypes>
</runner>
' in 'edit-config'
[2019-11-24 19:36:56.399] [ydk] [debug] ydk::path::Codec: Encoding data node '/ietf-netconf:edit-config' to XML formated string
[2019-11-24 19:36:56.399] [ydk] [info] ============= Sending RPC to device =============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <target>
    <candidate/>
  </target>
  <error-option>rollback-on-error</error-option>
  <config><runner xmlns="http://cisco.com/ns/yang/ydktest-sanity" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
  <ytypes>
    <built-in-t>
      <enum-llist>local</enum-llist>
    </built-in-t>
  </ytypes>
</runner>
</config>
</edit-config>
</rpc>
[2019-11-24 19:36:56.399] [ydk] [debug] NetconfSSHClient: NC session status: 1
[2019-11-24 19:36:56.399] [ydk] [debug] Trace: Missing message-id in rpc.
[2019-11-24 19:36:56.399] [ydk] [debug] Netconf SSH Client: sending RPC
[2019-11-24 19:36:56.399] [ydk] [debug] Trace: Writing message (session 749): 
<?xml version="1.0"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
  <edit-config>
    <target>
      <candidate/>
    </target>
    <error-option>rollback-on-error</error-option>
    <config>
      <runner xmlns="http://cisco.com/ns/yang/ydktest-sanity" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
        <ytypes>
          <built-in-t>
            <enum-llist>local</enum-llist>
          </built-in-t>
        </ytypes>
      </runner>
    </config>
  </edit-config>
</rpc>

[2019-11-24 19:36:56.399] [ydk] [debug] NetconfSSHClient: NC session status: 1
[2019-11-24 19:36:56.399] [ydk] [debug] Netconf SSH Client: receiving reply RPC
[2019-11-24 19:36:56.462] [ydk] [debug] Trace: Received message (session 749): 
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"><ok/></rpc-reply>
[2019-11-24 19:36:56.462] [ydk] [debug] Netconf SSH Client: processing reply
[2019-11-24 19:36:56.462] [ydk] [info] ============= Received RPC from device =============
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
  <ok/>
</rpc-reply>

[2019-11-24 19:36:56.462] [ydk] [info] ============= Executing commit =============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <commit/>
</rpc>

[2019-11-24 19:36:56.462] [ydk] [debug] NetconfSSHClient: NC session status: 1
[2019-11-24 19:36:56.462] [ydk] [debug] Trace: Missing message-id in rpc.
[2019-11-24 19:36:56.462] [ydk] [debug] Netconf SSH Client: sending RPC
[2019-11-24 19:36:56.462] [ydk] [debug] Trace: Writing message (session 749): 
<?xml version="1.0"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <commit/>
</rpc>

[2019-11-24 19:36:56.462] [ydk] [debug] NetconfSSHClient: NC session status: 1
[2019-11-24 19:36:56.462] [ydk] [debug] Netconf SSH Client: receiving reply RPC
[2019-11-24 19:36:56.593] [ydk] [debug] Trace: Received message (session 749): 
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"><ok/></rpc-reply>
[2019-11-24 19:36:56.594] [ydk] [debug] Netconf SSH Client: processing reply
[2019-11-24 19:36:56.594] [ydk] [info] ============= RPC received from device =============
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <ok/>
</rpc-reply>

[2019-11-24 19:36:56.594] [ydk] [debug] Getting new modules for path 'ydk:update'
[2019-11-24 19:36:56.594] [ydk] [debug] Loading module 'ydk', revision ''
[2019-11-24 19:36:56.594] [ydk] [debug] The module 'ydk' schema has already been populated in YDK repository
[2019-11-24 19:36:56.594] [ydk] [debug] Getting new modules for path 'ydktest-sanity:runner'
[2019-11-24 19:36:56.594] [ydk] [debug] Loading module 'ydktest-sanity', revision ''
[2019-11-24 19:36:56.594] [ydk] [debug] The module 'ydktest-sanity' schema has already been populated in YDK repository
[2019-11-24 19:36:56.594] [ydk] [debug] Enabled feature 'crypto' in 'ydktest-types'
[2019-11-24 19:36:56.594] [ydk] [debug] Enabled feature 'ipv4-non-contiguous-netmasks' in 'ydktest-sanity'
[2019-11-24 19:36:56.594] [ydk] [debug] Enabled feature 'ipv6-privacy-autoconf' in 'ydktest-sanity'
[2019-11-24 19:36:56.594] [ydk] [debug] Looking to populate schemas for 'ydktest-sanity:runner'
[2019-11-24 19:36:56.594] [ydk] [debug] Getting new modules for path 'ydktest-sanity:runner'
[2019-11-24 19:36:56.594] [ydk] [debug] Loading module 'ydktest-sanity', revision ''
[2019-11-24 19:36:56.594] [ydk] [debug] The module 'ydktest-sanity' schema has already been populated in YDK repository
[2019-11-24 19:36:56.594] [ydk] [debug] Enabled feature 'crypto' in 'ydktest-types'
[2019-11-24 19:36:56.594] [ydk] [debug] Enabled feature 'ipv4-non-contiguous-netmasks' in 'ydktest-sanity'
[2019-11-24 19:36:56.594] [ydk] [debug] Enabled feature 'ipv6-privacy-autoconf' in 'ydktest-sanity'
[2019-11-24 19:36:56.594] [ydk] [debug] Creating root data node with path '/ydktest-sanity:runner'
[2019-11-24 19:36:56.594] [ydk] [debug] [Go] path.getDataNodeFromEntity: Created datanode with path 'ydktest-sanity:runner'
[2019-11-24 19:36:56.595] [ydk] [debug] [Go] Got 23 entity children
[2019-11-24 19:36:56.595] [ydk] [debug] [Go] Looking at entity child 'one'
[2019-11-24 19:36:56.595] [ydk] [debug] [Go] Looking at entity child 'two'
[2019-11-24 19:36:56.595] [ydk] [debug] [Go] Looking at entity child 'three'
[2019-11-24 19:36:56.595] [ydk] [debug] [Go] Looking at entity child 'ytypes'
[2019-11-24 19:36:56.595] [ydk] [debug] Populating schema for 'ytypes'
[2019-11-24 19:36:56.595] [ydk] [debug] Looking to populate schemas for 'ytypes'
[2019-11-24 19:36:56.595] [ydk] [debug] Getting new modules for path 'ytypes'
[2019-11-24 19:36:56.595] [ydk] [debug] Creating node 'ytypes' with value ''
[2019-11-24 19:36:56.595] [ydk] [debug] Current path: /ydktest-sanity:runner
[2019-11-24 19:36:56.595] [ydk] [debug] Top container path: ydktest-sanity:runner
[2019-11-24 19:36:56.595] [ydk] [debug] Populating schema for 'ytypes'
[2019-11-24 19:36:56.595] [ydk] [debug] Looking to populate schemas for 'ytypes'
[2019-11-24 19:36:56.595] [ydk] [debug] Getting new modules for path 'ytypes'
[2019-11-24 19:36:56.595] [ydk] [debug] Getting child schema with path 'ytypes' in /ydktest-sanity:runner
[2019-11-24 19:36:56.595] [ydk] [debug] Getting data nodes with path 'ytypes'
[2019-11-24 19:36:56.595] [ydk] [debug] Creating new data path 'ytypes' with value '' in 'runner'
[2019-11-24 19:36:56.595] [ydk] [debug] [Go] path.populateDataNode: Populating leafs in datanode with path 'ydktest-sanity:runner/ytypes'
[2019-11-24 19:36:56.595] [ydk] [debug] [Go] Got 3 entity children
[2019-11-24 19:36:56.595] [ydk] [debug] [Go] Looking at entity child 'none'
[2019-11-24 19:36:56.595] [ydk] [debug] [Go] Looking at entity child 'built-in-t'
[2019-11-24 19:36:56.595] [ydk] [debug] Populating schema for 'built-in-t'
[2019-11-24 19:36:56.595] [ydk] [debug] Looking to populate schemas for 'built-in-t'
[2019-11-24 19:36:56.595] [ydk] [debug] Getting new modules for path 'built-in-t'
[2019-11-24 19:36:56.595] [ydk] [debug] Creating node 'built-in-t' with value ''
[2019-11-24 19:36:56.596] [ydk] [debug] Current path: /ydktest-sanity:runner/ytypes
[2019-11-24 19:36:56.596] [ydk] [debug] Top container path: ydktest-sanity:runner
[2019-11-24 19:36:56.596] [ydk] [debug] Populating schema for 'built-in-t'
[2019-11-24 19:36:56.596] [ydk] [debug] Looking to populate schemas for 'built-in-t'
[2019-11-24 19:36:56.596] [ydk] [debug] Getting new modules for path 'built-in-t'
[2019-11-24 19:36:56.596] [ydk] [debug] Getting child schema with path 'built-in-t' in /ydktest-sanity:runner/ytypes
[2019-11-24 19:36:56.596] [ydk] [debug] Getting data nodes with path 'built-in-t'
[2019-11-24 19:36:56.596] [ydk] [debug] Creating new data path 'built-in-t' with value '' in 'ytypes'
[2019-11-24 19:36:56.596] [ydk] [debug] [Go] path.populateDataNode: Populating leafs in datanode with path 'ydktest-sanity:runner/ytypes/built-in-t'
[2019-11-24 19:36:56.596] [ydk] [debug] [Go] path.populateNameValues: Got leaf {enum-llist: }
[2019-11-24 19:36:56.596] [ydk] [debug] Populating schema for 'enum-llist'
[2019-11-24 19:36:56.596] [ydk] [debug] Looking to populate schemas for 'enum-llist'
[2019-11-24 19:36:56.596] [ydk] [debug] Getting new modules for path 'enum-llist'
[2019-11-24 19:36:56.596] [ydk] [debug] Creating node 'enum-llist' with value ''
[2019-11-24 19:36:56.596] [ydk] [debug] Current path: /ydktest-sanity:runner/ytypes/built-in-t
[2019-11-24 19:36:56.596] [ydk] [debug] Top container path: ydktest-sanity:runner
[2019-11-24 19:36:56.596] [ydk] [debug] Populating schema for 'enum-llist'
[2019-11-24 19:36:56.596] [ydk] [debug] Looking to populate schemas for 'enum-llist'
[2019-11-24 19:36:56.596] [ydk] [debug] Getting new modules for path 'enum-llist'
[2019-11-24 19:36:56.596] [ydk] [debug] Getting child schema with path 'enum-llist' in /ydktest-sanity:runner/ytypes/built-in-t
[2019-11-24 19:36:56.596] [ydk] [debug] Getting data nodes with path 'enum-llist'
[2019-11-24 19:36:56.596] [ydk] [debug] Creating new data path 'enum-llist' with value '' in 'built-in-t'
[2019-11-24 19:36:56.596] [ydk] [error] Data is invalid according to the yang model. Libyang error: Invalid value "" in "enum-llist" element. Path: '/ydktest-sanity:runner/ytypes/built-in-t/enum-llist[.='']'
[2019-11-24 19:36:56.596] [ydk] [info] Disconnected from device
[2019-11-24 19:36:56.598] [ydk] [debug] Trace: Writing message (session 749): 
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6">
  <close-session/>
</rpc>

[2019-11-24 19:36:56.600] [ydk] [debug] Trace: Received message (session 749): 
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6"><ok/></rpc-reply>
--- FAIL: TestNETCONFOperationsTestSuite (0.57s)
    --- FAIL: TestNETCONFOperationsTestSuite/TestDeleteLeafList (0.43s)
    	suite.go:62: test panicked: YModelError: Invalid value "" in "enum-llist" element. Path: /ydktest-sanity:runner/ytypes/built-in-t/enum-llist[.='']
    		goroutine 4 [running]:
    		runtime/debug.Stack(0xc420301098, 0xe52fe0, 0xc4200a11d0)
    			/usr/lib/go/src/runtime/debug/stack.go:24 +0xa7
    		github.com/stretchr/testify/suite.failOnPanic(0xc42018a000)
    			/home/ygorelik/go/src/github.com/stretchr/testify/suite/suite.go:62 +0x60
    		panic(0xe52fe0, 0xc4200a11d0)
    			/usr/lib/go/src/runtime/panic.go:502 +0x229
    		github.com/CiscoDevNet/ydk-go/ydk/path.PanicOnCStateError(0xc420301218)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/path/path.go:1111 +0xc0
    		github.com/CiscoDevNet/ydk-go/ydk/path.populateNameValues(0xc4200c6358, 0x1a2f950, 0xf12f67, 0xa, 0xc420247a40, 0x1, 0x1)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/path/path.go:961 +0x2fe
    		github.com/CiscoDevNet/ydk-go/ydk/path.populateDataNode(0xc4200c6358, 0xf7c9a0, 0xc4202f4838, 0x1a307f0)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/path/path.go:944 +0x30d
    		github.com/CiscoDevNet/ydk-go/ydk/path.walkChildren(0xc4200c6358, 0xf7c980, 0xc4202f46a8, 0x1a307f0)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/path/path.go:916 +0x252
    		github.com/CiscoDevNet/ydk-go/ydk/path.populateDataNode(0xc4200c6358, 0xf7c980, 0xc4202f46a8, 0x1a2fc50)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/path/path.go:945 +0x342
    		github.com/CiscoDevNet/ydk-go/ydk/path.walkChildren(0xc4200c6358, 0xf7c2e0, 0xc4202f4000, 0x1a2fc50)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/path/path.go:916 +0x252
    		github.com/CiscoDevNet/ydk-go/ydk/path.getDataNodeFromEntity(0xc4200c6358, 0xf7c2e0, 0xc4202f4000, 0x7f1800062fe0, 0x0)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/path/path.go:899 +0x38f
    		github.com/CiscoDevNet/ydk-go/ydk/path.GetDataPayload(0xc4200c6358, 0xf7c2e0, 0xc4202f4000, 0x7f1800062fe0, 0xf80a40, 0xc4200c62d8, 0x0)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/path/path.go:115 +0x1f5
    		github.com/CiscoDevNet/ydk-go/ydk/path.ExecuteRPC(0xf80a40, 0xc4200c62d8, 0xf131bf, 0xa, 0xc4203018e8, 0x0, 0x0, 0x0)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/path/path.go:85 +0x39a
    		github.com/CiscoDevNet/ydk-go/ydk/providers.executeNetconfRpc(0xf80a40, 0xc4200c62d8, 0xf1164c, 0x6, 0xf7c2e0, 0xc4202f4000, 0xc420246330, 0xee44c0, 0xc420246330)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/providers/providers.go:206 +0x22c
    		github.com/CiscoDevNet/ydk-go/ydk/providers.(*NetconfServiceProvider).ExecuteRpc(0xc4200c62d8, 0xf1164c, 0x6, 0xf7c2e0, 0xc4202f4000, 0xc420246330, 0xc4200a0b80, 0xc4202f4000)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/providers/providers.go:212 +0x70
    		github.com/CiscoDevNet/ydk-go/ydk/services.(*CrudService).Update(0xc4200c6368, 0xf80a40, 0xc4200c62d8, 0xf7c2e0, 0xc4202f4000, 0xc4200a0b80)
    			/home/ygorelik/go/src/github.com/CiscoDevNet/ydk-go/ydk/services/services.go:61 +0x68
    		_/home/ygorelik/ydk-gen/sdk/go/core/tests.(*NETCONFOperationsTestSuite).TestDeleteLeafList(0xc4200c62c0)
    			/home/ygorelik/ydk-gen/sdk/go/core/tests/netconf_op_test.go:192 +0x193
    		reflect.Value.call(0xc42043d860, 0xc4200ae458, 0x13, 0xf107f7, 0x4, 0xc420301f80, 0x1, 0x1, 0xc420301ec8, 0xf0a740, ...)
    			/usr/lib/go/src/reflect/value.go:447 +0x969
    		reflect.Value.Call(0xc42043d860, 0xc4200ae458, 0x13, 0xc420301f80, 0x1, 0x1, 0xe27764, 0x12, 0x0)
    			/usr/lib/go/src/reflect/value.go:308 +0xa4
    		github.com/stretchr/testify/suite.Run.func2(0xc42018a000)
    			/home/ygorelik/go/src/github.com/stretchr/testify/suite/suite.go:133 +0x270
    		testing.tRunner(0xc42018a000, 0xc420174e80)
    			/usr/lib/go/src/testing/testing.go:777 +0xd0
    		created by testing.(*T).Run
    			/usr/lib/go/src/testing/testing.go:824 +0x2e0
FAIL
exit status 1
FAIL	_/home/ygorelik/ydk-gen/sdk/go/core/tests	0.591s

System Information

YDK-Go - 0.8.4

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions