Vagrant scripts adjusted for external YANG models and freebsd

This commit is contained in:
Olof hagsand 2021-11-30 15:22:00 +01:00
parent 6ab4e9dfdf
commit 2a84fb089f
6 changed files with 25 additions and 7 deletions

View file

@ -47,7 +47,7 @@ RUN apk add --update nghttp2
# Checkut models # Checkut models
WORKDIR /usr/local/share/ WORKDIR /usr/local/share/
# Checkut standard YANG models for tests (note >1G for full repo) # Checkout standard YANG models for tests (note >1G for full repo)
RUN mkdir yang; cd yang; git init; git remote add -f origin https://github.com/YangModels/yang; git config core.sparseCheckout true; echo "standard/" >> .git/info/sparse-checkout; echo "experimental/" >> .git/info/sparse-checkout RUN mkdir yang; cd yang; git init; git remote add -f origin https://github.com/YangModels/yang; git config core.sparseCheckout true; echo "standard/" >> .git/info/sparse-checkout; echo "experimental/" >> .git/info/sparse-checkout
WORKDIR /usr/local/share/yang WORKDIR /usr/local/share/yang

View file

@ -40,7 +40,6 @@ See [yang/clixon-config@<date>.yang](https://github.com/clicon/clixon/blob/maste
## Compile and run ## Compile and run
Before you start, Before you start,
* You must configure with: `--enable-optyangs` to install all yang files required for the example. This is not necessary for the base colixon system
* Setup clicon [groups](https://github.com/clicon/clixon/blob/master/doc/FAQ.md#do-i-need-to-setup-anything) * Setup clicon [groups](https://github.com/clicon/clixon/blob/master/doc/FAQ.md#do-i-need-to-setup-anything)
``` ```

View file

@ -30,6 +30,7 @@ cat <<EOF > $cfg
<CLICON_YANG_DIR>/usr/local/share/clixon</CLICON_YANG_DIR> <CLICON_YANG_DIR>/usr/local/share/clixon</CLICON_YANG_DIR>
<CLICON_YANG_DIR>$OPENCONFIG</CLICON_YANG_DIR> <CLICON_YANG_DIR>$OPENCONFIG</CLICON_YANG_DIR>
<CLICON_YANG_DIR>$IETFRFC</CLICON_YANG_DIR> <CLICON_YANG_DIR>$IETFRFC</CLICON_YANG_DIR>
<CLICON_YANG_AUGMENT_ACCEPT_BROKEN>true</CLICON_YANG_AUGMENT_ACCEPT_BROKEN>
<CLICON_CLISPEC_DIR>/usr/local/lib/$APPNAME/clispec</CLICON_CLISPEC_DIR> <CLICON_CLISPEC_DIR>/usr/local/lib/$APPNAME/clispec</CLICON_CLISPEC_DIR>
<CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR> <CLICON_CLI_DIR>/usr/local/lib/$APPNAME/cli</CLICON_CLI_DIR>
<CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE> <CLICON_CLI_MODE>$APPNAME</CLICON_CLI_MODE>

View file

@ -82,3 +82,5 @@ echo "IPv6=true" >> ./site.sh
if [ $release = "freebsd" ]; then if [ $release = "freebsd" ]; then
echo "make=gmake" >> ./site.sh echo "make=gmake" >> ./site.sh
fi fi
echo "OPENCONFIG=/usr/local/share/openconfig/public" >> ./site.sh
echo "YANGMODELS=/usr/local/share/yang" >> ./site.sh

View file

@ -285,6 +285,27 @@ esac
$scpcmd ./clixon.sh vagrant@127.0.0.1: $scpcmd ./clixon.sh vagrant@127.0.0.1:
$sshcmd ./clixon.sh $release $wwwuser ${with_restconf} $sshcmd ./clixon.sh $release $wwwuser ${with_restconf}
# Tests require yangmodels and openconfig
cat<<EOF > $dir/yangmodels.sh
cd /usr/local/share
mkdir yang
cd yang
git init
git remote add -f origin https://github.com/YangModels/yang
git config core.sparseCheckout true
echo "standard/" >> .git/info/sparse-checkout
echo "experimental/" >> .git/info/sparse-checkout
git pull origin master
mkdir /usr/local/share/openconfig
cd /usr/local/share/openconfig
git clone https://github.com/openconfig/public
# Patch yang syntax errors
sed -i s/=\ olt\'/=\ \'olt\'/g /usr/local/share/yang/standard/ieee/published/802.3/ieee802-ethernet-pon.yang
EOF
chmod 755 $dir/yangmodels.sh
$scpcmd $dir/yangmodels.sh vagrant@127.0.0.1:
$sshcmd sudo ./yangmodels.sh
# Run tests # Run tests
$sshcmd "(cd src/cligen/test; ./sum.sh)" $sshcmd "(cd src/cligen/test; ./sum.sh)"
$sshcmd "(cd src/clixon/test; ./sum.sh)" $sshcmd "(cd src/clixon/test; ./sum.sh)"

View file

@ -38,14 +38,9 @@ prefix = @prefix@
bindir = @bindir@ bindir = @bindir@
includedir = @includedir@ includedir = @includedir@
datarootdir = @datarootdir@ datarootdir = @datarootdir@
enable_optyangs = @enable_optyangs@
SUBDIRS = clixon SUBDIRS = clixon
SUBDIRS += mandatory SUBDIRS += mandatory
# See configure.ac
ifeq ($(enable_optyangs),yes)
SUBDIRS += optional
endif
.PHONY: all clean depend install $(SUBDIRS) .PHONY: all clean depend install $(SUBDIRS)