Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: python # support for pip, used to install ncclient
sudo: required
services:
- docker
before_install:
- pip install ncclient
script:
- docker build -t yuma .
- docker run -d -p 8300:830 -p 2200:22 --name yuma yuma
- while ! docker logs yuma | grep 'Running netconfd server'; do sleep 1; done
- sleep 5
- python -c "from ncclient import manager; m = manager.connect(host='127.0.0.1', port=8300, username='admin', password='admin', hostkey_verify=False); print(m.get_config(source='running'))"
- docker stop yuma
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:14.04

# install required packages
ENV DEBIAN_FRONTEND noninteractive
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "git", "autoconf", "gcc", "libtool", "libxml2-dev", "libssl-dev", "make", "libncurses5-dev", "libssh2-1-dev", "openssh-server"]

# setup admin user that yuma will use
RUN set -x -e; \
mkdir /var/run/sshd; \
adduser --gecos '' --disabled-password admin; \
echo "admin:admin" | chpasswd

# copy and build yuma, setup the container to start it by default
COPY . /usr/src/yuma123
WORKDIR /usr/src/yuma123
RUN set -x -e; \
autoreconf -i -f; \
./configure CFLAGS='-g -O0' CXXFLAGS='-g -O0' --prefix=/usr; \
make; \
sudo make install; \
touch /tmp/startup-cfg.xml; \
printf 'Port 830\nSubsystem netconf "/usr/sbin/netconf-subsystem --ncxserver-sockname=830@/tmp/ncxserver.sock"\n' >> /etc/ssh/sshd_config; \
printf '#!/bin/bash\nset -e -x\n/usr/sbin/netconfd --module=helloworld --startup=/tmp/startup-cfg.xml --superuser=admin &\nsleep 1\n/usr/sbin/sshd -D &\nwait\nkill %%\n' > /root/start.sh; \
chmod 0755 /root/start.sh
CMD ["/root/start.sh"]

# finishing touches
EXPOSE 22
EXPOSE 830
63 changes: 55 additions & 8 deletions README → README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
Yuma123 README
-----------
Yuma123
=======

Last Updated: 2015-06-18 (v2.5-1)

==What is Yuma123==
The purpose of the Yuma123 project is to provide an opensource YANG API in C and netconf cli (yangcli) and server (netconfd) appications.
Branching from the last BSD licensed branch of the Yuma project the code has evolved in the following direction:

What is Yuma123
---------------

The purpose of the Yuma123 project is to provide an opensource YANG API in C
and netconf cli (yangcli) and server (netconfd) appications.

Branching from the last BSD licensed branch of the Yuma project the code has
evolved in the following direction:
- a more mainstream build system based on autoconf/automake was added
- a number of critical bugs have been fixed
- new IETF standards support was added (ietf-nacm, ietf-system, etc.)
- support was added for new YANG extensions

==Checkout, Build and Installation steps (ment for Debian should be easy to figure out on other systems)==

Manual installation steps
-------------------------

~~~
sudo apt-get install git autoconf gcc libtool libxml2-dev libssl-dev libssh2-1-dev

git clone git://git.code.sf.net/p/yuma123/git yuma123-git
Expand All @@ -22,22 +32,59 @@ make
sudo make install
touch /tmp/startup-cfg.xml
/usr/sbin/netconfd --module=helloworld --startup=/tmp/startup-cfg.xml --log-level="debug4" --superuser="$USER"
~~~

If there were no missing dependencies the server is now started with the example helloworld module.
If there were no missing dependencies the server is now started with the
example helloworld module.

Tell sshd to listen on port 830. Add the following 2 lines to /etc/ssh/sshd_config:
Tell sshd to listen on port 830 by adding the following 2 lines
to `/etc/ssh/sshd_config`:

~~~
Port 830
Subsystem netconf "/usr/sbin/netconf-subsystem --ncxserver-sockname=830@/tmp/ncxserver.sock"
~~~

And restart the server:
~~~
sudo /etc/init.d/ssh restart
~~~

You can verify everything is OK:

~~~
yangcli --user="$USER" --server=localhost
...
xget /helloworld
~~~

or

~~~
xget /
~~~


Testing with docker
-------------------

This repository has a `Dockerfile` that can be used to create a container that
builds yuma and starts the service. You need a linux with working [docker]
installation to use it.

To build the container:
~~~
docker build -t yuma .
~~~

To start it:
~~~
docker run -it --rm -p 8300:830 -p 2200:22 --name yuma yuma
~~~

The line above maps yuma's netconf port to 8300 on the host. You can connect
to that port with ncclient.

To use *yangcli* as mentioned above, you `docker exec yuma /bin/bash` to enter
the running container. Use *admin* as both the user and password.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_INIT([yuma123], [2.4.0], [[email protected]])

AC_CANONICAL_SYSTEM

AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_INIT_AUTOMAKE([-Wall foreign])
LT_INIT([disable-static])

AC_PROG_CC
Expand Down