sonic-net / sonic-netconf-server

SONiC repo for netconf server feature
Other
1 stars 0 forks source link

Request for the check #9

Open simonleedotcom opened 6 days ago

simonleedotcom commented 6 days ago

Hi. First of all, thank you for your effort regarding this 'sonic-netconf-server' source.

I was trying to include NETCONF server in SONiC image with this source, and I just want to ask you a few questions about it.

  1. I tried to build Full-SONiC image(branch : 202311, PLATFORM=vs), including 'sonic-netconf-server' source and below pull request. https://github.com/sonic-net/sonic-buildimage/pull/19492

The command that I entered when trying to build the image was "make SONIC_BUILD_JOBS=4 target/docker-sonic-netconf-server.gz", but there has some build errors. It seems like some golang codes are problematic. Here are a part of build error logs below:

orange/sonic-netconf-server/netconf/server
# orange/sonic-netconf-server/netconf/server
server/subhandlers.go:60:18: undefined: translib.GetYanglibInfo
make[3]: *** [Makefile:42: ../build/netconf_server/netconf_server] Error 2
make[3]: Leaving directory '/sonic/src/sonic-netconf-server/netconf'
make[2]: *** [Makefile:54: netconf] Error 2
make[2]: Leaving directory '/sonic/src/sonic-netconf-server'
dh_auto_build: error: make -j1 returned exit code 2
make[1]: *** [debian/rules:3: build] Error 25
make[1]: Leaving directory '/sonic/src/sonic-netconf-server'
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
[  FAIL LOG END  ] [ target/debs/bullseye/sonic-netconf-server_1.0-01_amd64.deb ]

I guess the same function that works as 'GetYanglibInfo' is getYanglibInfo(), located in sonic-mgmt-common/translib/yanglib_app.go, so please refer to it.

142 func (app *yanglibApp) processGet(dbs [db.MaxDB]*db.DB, fmtType TranslibFmtType) (GetResponse, error) {
143         glog.Infof("path = %s", app.pathInfo.Template)
144         glog.Infof("vars = %s", app.pathInfo.Vars)
145 
146         var resp GetResponse
147         ylib, err := getYanglibInfo()
148         if err != nil {
149                 return resp, err
150         }
151         ...

I hope you can check this part so that the build error can be resolved.

  1. It seems like you tried to test NETCONF connection with ssh command(ssh <username>@<ip> -p 830 -s netconf). I also checked that the connection worked well with ssh command, but I guess it does not work normally when using the other tools as NETCONF client. For instance, I tried with Netopeer2-cli as the NETCONF client, and it did not work.
    load_config: No saved configuration.
    > connect --host {IP_ADDR} --login {USER}
    {USER}@{IP_ADDR} password:
    nc ERROR: Base NETCONF module not supported by the server.
    cmd_connect: Connecting to the {IP_ADDR}:830 as user "{USER}" failed.
    > status
    Client is not connected to any NETCONF server.
    > quit

I think this 'sonic-netconf-server' needs to satisfy the other NETCONF client tools before including in SONiC image.

Thank you.

hussamsh commented 5 days ago

Hi,

For your first issue regarding the build I'm still trying to get it to work, I can build it standalone but when integrated into the build-image there seems to be some issues importing libraries from the sonic-mgmt-common module. Thanks for the traces you provided they will help

As for the client interfacing, I tested this implementation with the "NETCONF browser" client and it seems to be working correctly, I also did some quick tests with NSO seems to also be working fine. Maybe there is some mis-configuration with your Netopeer2-cli ? I can investigate this further but I just need to get the build done first.

simonleedotcom commented 5 days ago

First of all, thank you for your quick reply, but I just have a few more things that I want to ask you.

  1. Do you have any plan or target date to merge the integration of this "sonic-netconf-server" into the build process?
  2. Did you just checked the NETCONF connection with various kind of clients, or you also tried the other RPC methods such as or ? If you have any test cases and results regarding the other NETCONF features (e.g. RPC) except for just checking the connections, please let me know so that I can also retry with your test cases.

Thank you.

hussamsh commented 1 day ago

1) For a merge date currently there is none, I am planning to finish it by start of next year but it depends on my workload during the next month

2) I tested some RPC commands such as , . It also seems to be working fine. As for the tests I will share the tests I am doing in the future after I am finished with the build, this project needs some work on the testing side also.