Test: optimization of vagrant git yangmodels handling
This commit is contained in:
parent
f6dbb30110
commit
1e44fa3719
1 changed files with 31 additions and 5 deletions
|
|
@ -279,7 +279,17 @@ $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
|
# Tests require yangmodels and openconfig
|
||||||
cat<<EOF > $dir/yangmodels.sh
|
if [ -d /usr/local/share/yang/standard ]; then
|
||||||
|
$scpcmd -r /usr/local/share/yang/standard/ vagrant@127.0.0.1:
|
||||||
|
|
||||||
|
cat<<EOF > $dir/yangmodels.sh
|
||||||
|
set -eux
|
||||||
|
rm -rf /usr/local/share/yang
|
||||||
|
mkdir /usr/local/share/yang
|
||||||
|
mv standard /usr/local/share/yang/
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
cat<<EOF > $dir/yangmodels.sh
|
||||||
set -eux
|
set -eux
|
||||||
cd /usr/local/share
|
cd /usr/local/share
|
||||||
rm -rf yang
|
rm -rf yang
|
||||||
|
|
@ -295,6 +305,22 @@ git pull origin main
|
||||||
# Patch yang syntax errors
|
# Patch yang syntax errors
|
||||||
sed s/=\ olt\'/=\ \'olt\'/g /usr/local/share/yang/standard/ieee/published/802.3/ieee802-ethernet-pon.yang > ieee802-ethernet-pon2.yang
|
sed s/=\ olt\'/=\ \'olt\'/g /usr/local/share/yang/standard/ieee/published/802.3/ieee802-ethernet-pon.yang > ieee802-ethernet-pon2.yang
|
||||||
mv ieee802-ethernet-pon2.yang /usr/local/share/yang/standard/ieee/published/802.3/ieee802-ethernet-pon.yang
|
mv ieee802-ethernet-pon2.yang /usr/local/share/yang/standard/ieee/published/802.3/ieee802-ethernet-pon.yang
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
chmod 755 $dir/yangmodels.sh
|
||||||
|
$scpcmd $dir/yangmodels.sh vagrant@127.0.0.1:
|
||||||
|
$sshcmd sudo ./yangmodels.sh
|
||||||
|
|
||||||
|
if [ -d /usr/local/share/openconfig ]; then
|
||||||
|
$scpcmd -r /usr/local/share/openconfig vagrant@127.0.0.1:
|
||||||
|
cat<<EOF > $dir/openconfig.sh
|
||||||
|
set -eux
|
||||||
|
rm -rf /usr/local/share/openconfig
|
||||||
|
mkdir /usr/local/share/openconfig
|
||||||
|
mv openconfig /usr/local/share/
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
cat<<EOF > $dir/openconfig.sh
|
||||||
# openconfig
|
# openconfig
|
||||||
cd /usr/local/share
|
cd /usr/local/share
|
||||||
rm -rf openconfig
|
rm -rf openconfig
|
||||||
|
|
@ -302,10 +328,10 @@ mkdir openconfig
|
||||||
cd openconfig
|
cd openconfig
|
||||||
git clone https://github.com/openconfig/public
|
git clone https://github.com/openconfig/public
|
||||||
EOF
|
EOF
|
||||||
chmod 755 $dir/yangmodels.sh
|
fi
|
||||||
$scpcmd $dir/yangmodels.sh vagrant@127.0.0.1:
|
chmod 755 $dir/openconfig.sh
|
||||||
$sshcmd sudo ./yangmodels.sh
|
$scpcmd $dir/openconfig.sh vagrant@127.0.0.1:
|
||||||
|
$sshcmd sudo ./openconfig.sh
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
$sshcmd "(cd src/cligen/test; ./sum.sh)"
|
$sshcmd "(cd src/cligen/test; ./sum.sh)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue