CiscoDevNet / ydk-gen

Generate model-driven APIs from YANG models
http://ciscodevnet.github.io/ydk-gen/
Apache License 2.0
137 stars 74 forks source link

Enable read only testing in CRUD #635

Open ylil93 opened 6 years ago

ylil93 commented 6 years ago

By writing sample apps for cisco_ios_xr in Go, I discovered that the Read() and ReadConfig() functions were swapped. This means we need to improve our test coverage for Read(). I've added a container that is read only in ydktest for future testing, but the issue is:

Currently, confd isn't configured to handle such testing.

ghost commented 6 years ago

Can use the yang model here for testing Read vs ReadConfig

ygorelik commented 3 years ago

In the fork added unit test (file sdk/go/core/tests/service_crud_test.go) for this issue using openconfig-bgp YANG model:

func (suite *CrudTestSuite) TestReadVsReadConfig() {
    // Delete BGP config
    bgp := ysanity_bgp.Bgp{}
    suite.CRUD.Delete(&suite.Provider, &bgp)

    // Create BGP config
    bgp.Global.Config.As = 65172
    bgp.Global.Config.RouterId = "1.2.3.4"
    neighbor := ysanity_bgp.Bgp_Neighbors_Neighbor{}
    neighbor.NeighborAddress = "172.16.255.2"
    neighbor.Config.NeighborAddress = "172.16.255.2"
    neighbor.Config.PeerAs = 65172
    bgp.Neighbors.Neighbor = append(bgp.Neighbors.Neighbor, &neighbor)
    suite.CRUD.Create(&suite.Provider, &bgp)

    // Read  BGP Config and Status, then compare
    bgp = ysanity_bgp.Bgp{}
    bgpConfigEntity := suite.CRUD.ReadConfig(&suite.Provider, &bgp)
    bgpStatusEntity := suite.CRUD.Read(&suite.Provider, &bgp)
    suite.NotEqual(GetEntityXMLString(bgpConfigEntity), GetEntityXMLString(bgpStatusEntity))

    suite.CRUD.Delete(&suite.Provider, &bgp)
}

Proved that CrudService methods Read and ReadConfig work properly. Here is test output:

tests ygorelik$ go test -v -run CrudTestSuite/TestReadVsReadConfig
=== RUN   TestCrudTestSuite
[2021-08-04 09:44:39.722] [ydk] [info] ============= Requesting YANG 1.1 capabilities =============
[2021-08-04 09:44:39.735] [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="1">
  <data>
    <modules-state xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">
      <module>
        <name>iana-crypt-hash</name>
        <revision>2014-08-06</revision>
        <namespace>urn:ietf:params:xml:ns:yang:iana-crypt-hash</namespace>
        <feature>crypt-hash-md5</feature>
        <feature>crypt-hash-sha-256</feature>
        <feature>crypt-hash-sha-512</feature>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>iana-if-type</name>
        <revision>2014-05-08</revision>
        <namespace>urn:ietf:params:xml:ns:yang:iana-if-type</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ietf-aug-base-1</name>
        <revision>2016-07-01</revision>
        <namespace>http://cisco.com/ns/yang/ietf-aug-base-1</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-aug-base-2</name>
        <revision>2016-07-01</revision>
        <namespace>http://cisco.com/ns/yang/ietf-aug-base-2</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-datastores</name>
        <revision>2018-02-14</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-datastores</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ietf-inet-types</name>
        <revision>2013-07-15</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-inet-types</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ietf-interfaces</name>
        <revision>2018-02-20</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-interfaces</namespace>
        <feature>arbitrary-names</feature>
        <feature>if-mib</feature>
        <feature>pre-provisioning</feature>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ietf-ip</name>
        <revision>2018-02-22</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-ip</namespace>
        <feature>ipv4-non-contiguous-netmasks</feature>
        <feature>ipv6-privacy-autoconf</feature>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ietf-netconf</name>
        <revision>2011-06-01</revision>
        <namespace>urn:ietf:params:xml:ns:netconf:base:1.0</namespace>
        <feature>candidate</feature>
        <feature>confirmed-commit</feature>
        <feature>rollback-on-error</feature>
        <feature>validate</feature>
        <feature>writable-running</feature>
        <feature>xpath</feature>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-netconf-acm</name>
        <revision>2018-02-14</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-netconf-acm</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-netconf-monitoring</name>
        <revision>2010-10-04</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-netconf-nmda</name>
        <revision>2019-01-07</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-netconf-nmda</namespace>
        <feature>with-defaults</feature>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-netconf-notifications</name>
        <revision>2012-02-06</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-netconf-notifications</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-netconf-partial-lock</name>
        <revision>2009-10-19</revision>
        <namespace>urn:ietf:params:xml:ns:netconf:partial-lock:1.0</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-netconf-with-defaults</name>
        <revision>2011-06-01</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-network-instance</name>
        <revision>2019-01-21</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-network-instance</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ietf-origin</name>
        <revision>2018-02-14</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-origin</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ietf-subscribed-notifications</name>
        <revision>2019-09-09</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications</namespace>
        <feature>encode-xml</feature>
        <feature>replay</feature>
        <feature>subtree</feature>
        <feature>xpath</feature>
        <deviation>
          <name>ietf-subscribed-notifications-deviation</name>
          <revision/>
        </deviation>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-x509-cert-to-name</name>
        <revision>2014-12-10</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ietf-yang-library</name>
        <revision>2019-01-04</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-library</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ietf-yang-types</name>
        <revision>2013-07-15</revision>
        <namespace>urn:ietf:params:xml:ns:yang:ietf-yang-types</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>main</name>
        <revision>2015-11-17</revision>
        <namespace>http://cisco.com/ns/yang/main</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>main-aug1</name>
        <revision>2015-11-17</revision>
        <namespace>http://cisco.com/ns/yang/main-aug1</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>oc-pattern</name>
        <revision>2015-11-17</revision>
        <namespace>http://cisco.com/ns/yang/oc-pattern</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>openconfig-bgp</name>
        <revision>2016-06-21</revision>
        <namespace>http://openconfig.net/yang/bgp</namespace>
        <conformance-type>implement</conformance-type>
        <submodule>
          <name>openconfig-bgp-common</name>
          <revision>2016-06-21</revision>
        </submodule>
        <submodule>
          <name>openconfig-bgp-common-multiprotocol</name>
          <revision>2016-06-21</revision>
        </submodule>
        <submodule>
          <name>openconfig-bgp-common-structure</name>
          <revision>2016-06-21</revision>
        </submodule>
        <submodule>
          <name>openconfig-bgp-global</name>
          <revision>2016-06-21</revision>
        </submodule>
        <submodule>
          <name>openconfig-bgp-neighbor</name>
          <revision>2016-06-21</revision>
        </submodule>
        <submodule>
          <name>openconfig-bgp-peer-group</name>
          <revision>2016-06-21</revision>
        </submodule>
      </module>
      <module>
        <name>openconfig-bgp-operational</name>
        <revision>2015-10-09</revision>
        <namespace>http://openconfig.net/yang/bgp-operational</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>openconfig-bgp-policy</name>
        <revision>2016-06-21</revision>
        <namespace>http://openconfig.net/yang/bgp-policy</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>openconfig-bgp-types</name>
        <revision>2016-06-21</revision>
        <namespace>http://openconfig.net/yang/bgp-types</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>openconfig-extensions</name>
        <revision>2015-10-09</revision>
        <namespace>http://openconfig.net/yang/openconfig-ext</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>openconfig-if-ethernet</name>
        <revision>2016-05-26</revision>
        <namespace>http://openconfig.net/yang/interfaces/ethernet</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>openconfig-interfaces</name>
        <revision>2016-05-26</revision>
        <namespace>http://openconfig.net/yang/interfaces</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>openconfig-platform</name>
        <revision>2016-06-06</revision>
        <namespace>http://openconfig.net/yang/platform</namespace>
        <deviation>
          <name>cisco-xr-openconfig-platform-deviations</name>
          <revision>2016-10-16</revision>
        </deviation>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>openconfig-platform-transceiver</name>
        <revision>2016-05-24</revision>
        <namespace>http://openconfig.net/yang/platform/transceiver</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>openconfig-platform-types</name>
        <revision>2016-06-06</revision>
        <namespace>http://openconfig.net/yang/platform-types</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>openconfig-policy-types</name>
        <revision>2016-05-12</revision>
        <namespace>http://openconfig.net/yang/policy-types</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>openconfig-routing-policy</name>
        <revision>2016-05-12</revision>
        <namespace>http://openconfig.net/yang/routing-policy</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>openconfig-terminal-device</name>
        <revision>2016-06-17</revision>
        <namespace>http://openconfig.net/yang/terminal-device</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>openconfig-transport-types</name>
        <revision>2016-06-17</revision>
        <namespace>http://openconfig.net/yang/transport-types</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>openconfig-types</name>
        <revision>2016-05-31</revision>
        <namespace>http://openconfig.net/yang/openconfig-types</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>tailf-aaa</name>
        <revision>2018-09-12</revision>
        <namespace>http://tail-f.com/ns/aaa/1.1</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-acm</name>
        <revision>2013-03-07</revision>
        <namespace>http://tail-f.com/yang/acm</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-common</name>
        <revision>2019-11-30</revision>
        <namespace>http://tail-f.com/yang/common</namespace>
        <conformance-type>import</conformance-type>
        <submodule>
          <name>tailf-cli-extensions</name>
          <revision>2019-11-28</revision>
        </submodule>
        <submodule>
          <name>tailf-meta-extensions</name>
          <revision>2017-03-08</revision>
        </submodule>
      </module>
      <module>
        <name>tailf-common-monitoring</name>
        <revision>2019-04-09</revision>
        <namespace>http://tail-f.com/yang/common-monitoring</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>tailf-common-query</name>
        <revision>2017-12-15</revision>
        <namespace>http://tail-f.com/ns/common/query</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>tailf-confd-monitoring</name>
        <revision>2019-10-30</revision>
        <namespace>http://tail-f.com/yang/confd-monitoring</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-kicker</name>
        <revision>2017-09-28</revision>
        <namespace>http://tail-f.com/ns/kicker</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-netconf-extensions</name>
        <revision>2019-04-09</revision>
        <namespace>http://tail-f.com/ns/netconf/extensions</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-netconf-forward</name>
        <revision/>
        <namespace>http://tail-f.com/ns/netconf/forward/1.0</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>tailf-netconf-inactive</name>
        <revision/>
        <namespace>http://tail-f.com/ns/netconf/inactive/1.0</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>tailf-netconf-monitoring</name>
        <revision>2019-03-28</revision>
        <namespace>http://tail-f.com/yang/netconf-monitoring</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-netconf-query</name>
        <revision>2017-01-06</revision>
        <namespace>http://tail-f.com/ns/netconf/query</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-netconf-rollback</name>
        <revision>2018-01-12</revision>
        <namespace>http://tail-f.com/ns/netconf/rollback</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-netconf-transactions</name>
        <revision/>
        <namespace>http://tail-f.com/ns/netconf/transactions/1.0</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-netconf-with-transaction-id</name>
        <revision>2018-11-23</revision>
        <namespace>http://tail-f.com/ns/netconf/with-transaction-id</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-progress</name>
        <revision>2018-06-14</revision>
        <namespace>http://tail-f.com/ns/progress</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-rollback</name>
        <revision>2018-01-12</revision>
        <namespace>http://tail-f.com/ns/rollback</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>tailf-xsd-types</name>
        <revision>2017-11-20</revision>
        <namespace>http://tail-f.com/yang/xsd-types</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ydktest-aug-ietf-1</name>
        <revision>2016-06-17</revision>
        <namespace>http://cisco.com/ns/yang/yaug-one</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ydktest-aug-ietf-2</name>
        <revision>2016-06-22</revision>
        <namespace>http://cisco.com/ns/yang/yaug-two</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ydktest-aug-ietf-4</name>
        <revision>2016-06-27</revision>
        <namespace>http://cisco.com/ns/yang/yaug-four</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ydktest-aug-ietf-5</name>
        <revision>2017-07-26</revision>
        <namespace>http://cisco.com/ns/yang/yaug-five</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ydktest-filterread</name>
        <revision>2015-11-17</revision>
        <namespace>http://cisco.com/ns/yang/ydk-filter</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ydktest-sanity</name>
        <revision>2015-11-17</revision>
        <namespace>http://cisco.com/ns/yang/ydktest-sanity</namespace>
        <feature>ipv4-non-contiguous-netmasks</feature>
        <feature>ipv6-privacy-autoconf</feature>
        <conformance-type>implement</conformance-type>
        <submodule>
          <name>ydktest-sanity-submodule</name>
          <revision>2016-04-25</revision>
        </submodule>
      </module>
      <module>
        <name>ydktest-sanity-augm</name>
        <revision>2015-11-17</revision>
        <namespace>http://cisco.com/ns/yang/ydktest-sanity-augm</namespace>
        <conformance-type>implement</conformance-type>
      </module>
      <module>
        <name>ydktest-sanity-types</name>
        <revision>2016-04-11</revision>
        <namespace>http://cisco.com/ns/yang/ydktest-sanity-types</namespace>
        <conformance-type>import</conformance-type>
      </module>
      <module>
        <name>ydktest-types</name>
        <revision>2016-05-23</revision>
        <namespace>http://cisco.com/ns/yang/ydktest-types</namespace>
        <feature>crypto</feature>
        <conformance-type>implement</conformance-type>
      </module>
    </modules-state>
  </data>
</rpc-reply>

[2021-08-04 09:44:39.738] [ydk] [info] Path where models are to be downloaded: /Users/ygorelik/.ydk/127.0.0.1
[2021-08-04 09:44:39.744] [ydk] [info] Connected to 127.0.0.1 on port 12022 using ssh with timeout of -1
=== RUN   TestCrudTestSuite/TestReadVsReadConfig
[2021-08-04 09:44:39.749] [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="delete"/>
</config>
</edit-config>
</rpc>
[2021-08-04 09:44:39.755] [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="2">
  <ok/>
</rpc-reply>

[2021-08-04 09:44:39.755] [ydk] [info] ============= Executing commit =============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <commit/>
</rpc>

[2021-08-04 09:44:39.770] [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="3">
  <ok/>
</rpc-reply>

CrudTestSuite: TestReadVsReadConfig ...
[2021-08-04 09:44:39.791] [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><bgp xmlns="http://openconfig.net/yang/bgp" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="delete"/>
</config>
</edit-config>
</rpc>
[2021-08-04 09:44:39.796] [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>

[2021-08-04 09:44:39.796] [ydk] [info] ============= Executing commit =============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <commit/>
</rpc>

[2021-08-04 09:44:39.811] [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>

[2021-08-04 09:44:39.815] [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><bgp xmlns="http://openconfig.net/yang/bgp" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
  <global>
    <config>
      <as>65172</as>
      <router-id>1.2.3.4</router-id>
    </config>
  </global>
  <neighbors>
    <neighbor>
      <neighbor-address>172.16.255.2</neighbor-address>
      <config>
        <neighbor-address>172.16.255.2</neighbor-address>
        <peer-as>65172</peer-as>
      </config>
    </neighbor>
  </neighbors>
</bgp>
</config>
</edit-config>
</rpc>
[2021-08-04 09:44:39.824] [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="6">
  <ok/>
</rpc-reply>

[2021-08-04 09:44:39.824] [ydk] [info] ============= Executing commit =============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <commit/>
</rpc>

[2021-08-04 09:44:39.850] [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="7">
  <ok/>
</rpc-reply>

[2021-08-04 09:44:39.852] [ydk] [info] ============= Sending RPC to device =============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <source>
    <running/>
  </source>
  <filter><bgp xmlns="http://openconfig.net/yang/bgp"/></filter>
</get-config>
</rpc>
[2021-08-04 09:44:39.857] [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="8">
  <data>
    <bgp xmlns="http://openconfig.net/yang/bgp">
      <global>
        <config>
          <as>65172</as>
          <router-id>1.2.3.4</router-id>
        </config>
      </global>
      <neighbors>
        <neighbor>
          <neighbor-address>172.16.255.2</neighbor-address>
          <config>
            <neighbor-address>172.16.255.2</neighbor-address>
            <peer-as>65172</peer-as>
          </config>
        </neighbor>
      </neighbors>
    </bgp>
  </data>
</rpc-reply>

[2021-08-04 09:44:39.859] [ydk] [info] ============= Sending RPC to device =============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <filter><bgp xmlns="http://openconfig.net/yang/bgp"/></filter>
</get>
</rpc>
[2021-08-04 09:44:39.867] [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="9">
  <data>
    <bgp xmlns="http://openconfig.net/yang/bgp">
      <global>
        <config>
          <as>65172</as>
          <router-id>1.2.3.4</router-id>
        </config>
        <use-multiple-paths>
          <state>
            <enabled>false</enabled>
          </state>
          <ebgp>
            <state>
              <allow-multiple-as>false</allow-multiple-as>
              <maximum-paths>1</maximum-paths>
            </state>
          </ebgp>
          <ibgp>
            <state>
              <maximum-paths>1</maximum-paths>
            </state>
          </ibgp>
        </use-multiple-paths>
        <route-selection-options>
          <state>
            <always-compare-med>false</always-compare-med>
            <ignore-as-path-length>false</ignore-as-path-length>
            <external-compare-router-id>true</external-compare-router-id>
            <advertise-inactive-routes>false</advertise-inactive-routes>
            <enable-aigp>false</enable-aigp>
            <ignore-next-hop-igp-metric>false</ignore-next-hop-igp-metric>
          </state>
        </route-selection-options>
        <apply-policy>
          <state>
            <default-import-policy>REJECT_ROUTE</default-import-policy>
            <default-export-policy>REJECT_ROUTE</default-export-policy>
          </state>
        </apply-policy>
      </global>
      <neighbors>
        <neighbor>
          <neighbor-address>172.16.255.2</neighbor-address>
          <config>
            <neighbor-address>172.16.255.2</neighbor-address>
            <peer-as>65172</peer-as>
          </config>
          <state>
            <enabled>true</enabled>
            <route-flap-damping>false</route-flap-damping>
            <send-community>NONE</send-community>
          </state>
          <timers>
            <state>
              <connect-retry>30.0</connect-retry>
              <hold-time>90.0</hold-time>
              <keepalive-interval>30.0</keepalive-interval>
              <minimum-advertisement-interval>30.0</minimum-advertisement-interval>
            </state>
          </timers>
          <transport>
            <state>
              <mtu-discovery>false</mtu-discovery>
              <passive-mode>false</passive-mode>
            </state>
          </transport>
          <error-handling>
            <state>
              <treat-as-withdraw>false</treat-as-withdraw>
            </state>
          </error-handling>
          <logging-options>
            <state>
              <log-neighbor-state-changes>true</log-neighbor-state-changes>
            </state>
          </logging-options>
          <ebgp-multihop>
            <state>
              <enabled>false</enabled>
            </state>
          </ebgp-multihop>
          <route-reflector>
            <state>
              <route-reflector-client>false</route-reflector-client>
            </state>
          </route-reflector>
          <as-path-options>
            <state>
              <allow-own-as>0</allow-own-as>
              <replace-peer-as>false</replace-peer-as>
            </state>
          </as-path-options>
          <add-paths>
            <state>
              <receive>false</receive>
            </state>
          </add-paths>
          <use-multiple-paths>
            <state>
              <enabled>false</enabled>
            </state>
            <ebgp>
              <state>
                <allow-multiple-as>false</allow-multiple-as>
              </state>
            </ebgp>
          </use-multiple-paths>
          <apply-policy>
            <state>
              <default-import-policy>REJECT_ROUTE</default-import-policy>
              <default-export-policy>REJECT_ROUTE</default-export-policy>
            </state>
          </apply-policy>
        </neighbor>
      </neighbors>
    </bgp>
  </data>
</rpc-reply>

[2021-08-04 09:44:39.954] [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><bgp xmlns="http://openconfig.net/yang/bgp" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="delete"/>
</config>
</edit-config>
</rpc>
[2021-08-04 09:44:39.962] [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="10">
  <ok/>
</rpc-reply>

[2021-08-04 09:44:39.962] [ydk] [info] ============= Executing commit =============
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <commit/>
</rpc>

[2021-08-04 09:44:39.991] [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="11">
  <ok/>
</rpc-reply>

[2021-08-04 09:44:39.991] [ydk] [info] Disconnected from device
--- PASS: TestCrudTestSuite (0.30s)
    --- PASS: TestCrudTestSuite/TestReadVsReadConfig (0.25s)
PASS
ok      _/Users/ygorelik/gitlab/ydk-gen/sdk/go/core/tests   0.323s

It is recommended to close this issue.