Skip to content

Commit cabedad

Browse files
committed
Merge branch 'linter-github-action' into fix-ebpf-in-srv6-pm-topo
2 parents d90e28b + ed4bed9 commit cabedad

File tree

127 files changed

+171
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+171
-331
lines changed

.github/workflows/shell_linter.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Shell Linter
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
push:
7+
branches: [ master ]
8+
pull_request:
9+
branches: [ master ]
10+
11+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
12+
jobs:
13+
shell-lint:
14+
# The type of runner that the job will run on
15+
runs-on: ubuntu-latest
16+
17+
# Steps represent a sequence of tasks that will be executed as part of the job
18+
steps:
19+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
20+
- uses: actions/checkout@v2
21+
22+
- name: Shell Linter
23+
uses: reviewdog/action-shellcheck@v1
24+
with:
25+
github_token: ${{ secrets.github_token }}
26+
reporter: github-pr-review # Change reporter.
27+
path: "." # Optional.
28+
pattern: "*.sh" # Optional.
29+
exclude: "./.git/*" # Optional.
30+
fail_on_error: true
31+
level: "info"
32+
shellcheck_flags: --severity=style --external-sources
33+
filter_mode: "nofilter"

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@
33
*.pyc
44
*.log
55
*.pid
6-
*.swp
6+
*.swp
7+
8+
nets/3routers/starter.sh
9+
nets/8routers/starter.sh
10+
nets/8routers-isis-ipv6/starter.sh
11+
nets/8r-1c-in-band-isis/starter.sh
12+
nets/8r-1c-out-band-isis/starter.sh
13+
nets/8r-1c-srv6-pm/starter.sh

nets/3routers/.venv

Lines changed: 0 additions & 1 deletion
This file was deleted.

nets/3routers/nodeconf/h1/start.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/sh
22

3-
BASE_DIR=/home/user/mytests/ospf3routers/nodeconf
43
NODE_NAME=h1
54
GW_NAME=r1
65
IF_NAME=$NODE_NAME-$GW_NAME

nets/3routers/nodeconf/h2/start.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/sh
22

3-
BASE_DIR=/home/user/mytests/ospf3routers/nodeconf
43
NODE_NAME=h2
54
GW_NAME=r2
65
IF_NAME=$NODE_NAME-$GW_NAME

nets/3routers/nodeconf/h3/start.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/sh
22

3-
BASE_DIR=/home/user/mytests/ospf3routers/nodeconf
43
NODE_NAME=h3
54
GW_NAME=r3
65
IF_NAME=$NODE_NAME-$GW_NAME

nets/3routers/nodeconf/r1/start.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ sysctl -w net.ipv4.ip_forward=1
1212
#sysctl -w net.ipv4.conf.default.rp_filter=0
1313
#the following for loop also disables all and default
1414
for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do
15-
echo 0 > $i
15+
echo 0 > "$i"
1616
done
1717

1818

1919
echo "no service integrated-vtysh-config" >> /etc/frr/vtysh.conf
2020
chown frr:frrvty $BASE_DIR/$NODE_NAME
2121
#chown quagga:quagga $BASE_DIR/$NODE_NAME
2222

23-
$FRR_PATH/zebra -f $PWD/$BASE_DIR/$NODE_NAME/zebra.conf -d -z $PWD/$BASE_DIR/$NODE_NAME/zebra.sock -i $PWD/$BASE_DIR/$NODE_NAME/zebra.pid
23+
$FRR_PATH/zebra -f "$PWD"/$BASE_DIR/$NODE_NAME/zebra.conf -d -z "$PWD"/$BASE_DIR/$NODE_NAME/zebra.sock -i "$PWD"/$BASE_DIR/$NODE_NAME/zebra.pid
2424

2525
sleep 1
2626

27-
$FRR_PATH/ospfd -f $PWD/$BASE_DIR/$NODE_NAME/ospfd.conf -d -z $PWD/$BASE_DIR/$NODE_NAME/zebra.sock -i $PWD/$BASE_DIR/$NODE_NAME/ospfd.pid
27+
$FRR_PATH/ospfd -f "$PWD"/$BASE_DIR/$NODE_NAME/ospfd.conf -d -z "$PWD"/$BASE_DIR/$NODE_NAME/zebra.sock -i "$PWD"/$BASE_DIR/$NODE_NAME/ospfd.pid

nets/3routers/nodeconf/r2/start.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ sysctl -w net.ipv4.ip_forward=1
1212
#sysctl -w net.ipv4.conf.default.rp_filter=0
1313
#the following for loop also disables all and default
1414
for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do
15-
echo 0 > $i
15+
echo 0 > "$i"
1616
done
1717

1818

1919
echo "no service integrated-vtysh-config" >> /etc/frr/vtysh.conf
2020
chown frr:frrvty $BASE_DIR/$NODE_NAME
2121
#chown quagga:quagga $BASE_DIR/$NODE_NAME
2222

23-
$FRR_PATH/zebra -f $PWD/$BASE_DIR/$NODE_NAME/zebra.conf -d -z $PWD/$BASE_DIR/$NODE_NAME/zebra.sock -i $PWD/$BASE_DIR/$NODE_NAME/zebra.pid
23+
$FRR_PATH/zebra -f "$PWD"/$BASE_DIR/$NODE_NAME/zebra.conf -d -z "$PWD"/$BASE_DIR/$NODE_NAME/zebra.sock -i "$PWD"/$BASE_DIR/$NODE_NAME/zebra.pid
2424

2525
sleep 1
2626

27-
$FRR_PATH/ospfd -f $PWD/$BASE_DIR/$NODE_NAME/ospfd.conf -d -z $PWD/$BASE_DIR/$NODE_NAME/zebra.sock -i $PWD/$BASE_DIR/$NODE_NAME/ospfd.pid
27+
$FRR_PATH/ospfd -f "$PWD"/$BASE_DIR/$NODE_NAME/ospfd.conf -d -z "$PWD"/$BASE_DIR/$NODE_NAME/zebra.sock -i "$PWD"/$BASE_DIR/$NODE_NAME/ospfd.pid

nets/3routers/nodeconf/r3/start.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ sysctl -w net.ipv4.ip_forward=1
1212
#sysctl -w net.ipv4.conf.default.rp_filter=0
1313
#the following for loop also disables all and default
1414
for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do
15-
echo 0 > $i
15+
echo 0 > "$i"
1616
done
1717

1818

1919
echo "no service integrated-vtysh-config" >> /etc/frr/vtysh.conf
2020
chown frr:frrvty $BASE_DIR/$NODE_NAME
2121
#chown quagga:quagga $BASE_DIR/$NODE_NAME
2222

23-
$FRR_PATH/zebra -f $PWD/$BASE_DIR/$NODE_NAME/zebra.conf -d -z $PWD/$BASE_DIR/$NODE_NAME/zebra.sock -i $PWD/$BASE_DIR/$NODE_NAME/zebra.pid
23+
$FRR_PATH/zebra -f "$PWD"/$BASE_DIR/$NODE_NAME/zebra.conf -d -z "$PWD"/$BASE_DIR/$NODE_NAME/zebra.sock -i "$PWD"/$BASE_DIR/$NODE_NAME/zebra.pid
2424

2525
sleep 1
2626

27-
$FRR_PATH/ospfd -f $PWD/$BASE_DIR/$NODE_NAME/ospfd.conf -d -z $PWD/$BASE_DIR/$NODE_NAME/zebra.sock -i $PWD/$BASE_DIR/$NODE_NAME/ospfd.pid
27+
$FRR_PATH/ospfd -f "$PWD"/$BASE_DIR/$NODE_NAME/ospfd.conf -d -z "$PWD"/$BASE_DIR/$NODE_NAME/zebra.sock -i "$PWD"/$BASE_DIR/$NODE_NAME/ospfd.pid

nets/3routers/ospf3r.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,6 @@
22

33
import os
44

5-
# Activate virtual environment if a venv path has been specified in .venv
6-
# This must be executed only if this file has been executed as a
7-
# script (instead of a module)
8-
if __name__ == '__main__':
9-
# Check if .venv file exists
10-
if os.path.exists('.venv'):
11-
with open('.venv', 'r') as venv_file:
12-
# Get virtualenv path from .venv file
13-
# and remove trailing newline chars
14-
venv_path = venv_file.read().rstrip()
15-
# Get path of the activation script
16-
venv_path = os.path.join(venv_path, 'bin/activate_this.py')
17-
if not os.path.exists(venv_path):
18-
print('Virtual environment path specified in .venv '
19-
'points to an invalid path\n')
20-
exit(-2)
21-
with open(venv_path) as f:
22-
# Read the activation script
23-
code = compile(f.read(), venv_path, 'exec')
24-
# Execute the activation script to activate the venv
25-
exec(code, {'__file__': venv_path})
26-
275
import shutil
286
from mininet.topo import Topo
297
from mininet.node import Host

0 commit comments

Comments
 (0)