Fix invalid JSON and add test script

This commit is contained in:
rany 2021-10-31 13:20:08 +02:00
parent c8c6959c2a
commit ca99a5c11e
10 changed files with 77 additions and 59 deletions

View File

@ -1,8 +1,8 @@
{
"route": [
"route": {
"fdd2:cbf2:61bd::/48": {
"description": "deavmi.home.network1",
"device": [
"device": {
"fdd2:cbf2:61bd::1": {
"type": "router"
},
@ -31,7 +31,7 @@
]
}
]
}
},
"fdd2:cbf2:61bd::4": {
"type": "server",
"service": [
@ -44,19 +44,19 @@
}
]
}
]
}
},
"fda2:a9b0:a02b::/48": {
"description": "deavmi.home.network2",
"device": [
"device": {
"fda2:a9b0:a02b::1": {
"type": "router"
}
]
}
},
"fd08:8441:e254::/48": {
"description": "deavmi.community.network1",
"device": [
"device": {
"fd08:8441:e254::1": {
"type": "router"
},
@ -79,47 +79,47 @@
}
]
}
]
}
},
"fdf1:1dc1:f54d::/48": {
"description": "deavmi.community.quickconnect.network1",
"device": [
"device": {
"fdf1:1dc1:f54d::1": {
"type": "router"
}
]
}
},
"fd1d:370c:38ee::/48": {
"description": "deavmi.community.network2",
"device": [
"device": {
"fd1d:370c:38ee::1": {
"type": "router"
}
]
}
},
"fd06:3184:2093::/48": {
"description": "deavmi.stellenbosch.network1",
"device": [
"device": {
"fd06:3184:2093::1": {
"type": "router"
}
]
}
}
},
"fd8c:730a:7572::/48": {
"description": "deavmi.ospfnet.network1",
"device": [
"device": {
"fd8c:730a:7572::1": {
"type": "router"
}
]
}
}
},
"fde3:3226:fe0c::/48": {
"description": "deavmi.ospfnet.network2",
"device": [
"device": {
"fde3:3226:fe0c::1": {
"type": "router"
}
]
}
}
]
}
}

View File

@ -1,8 +1,8 @@
{
"route": [
"route": {
"fd87:b911:92e0::/48": {
"description": "lagemeet.home.network",
"device": [
"device": {
"fd87:b911:92e0:::1": {
"type": "router"
},
@ -17,7 +17,7 @@
}
]
}
]
}
}
]
}
}

View File

@ -1,12 +1,12 @@
{
"route": [
"route": {
"fdcf:25b5:8c10::/48": {
"description": "minus.home.network",
"device": [
"device": {
"fdcf:25b5:8c10::1": {
"type": "router"
}
]
}
}
]
}
}

View File

@ -1,20 +1,20 @@
{
"route": [
"route": {
"fdfb:1a20:a9bf::/48": {
"description": "rany.server.network1",
"device": [
"device": {
"fdfb:1a20:a9bf::1": {
"type": "router"
}
]
}
},
"2a04:5b81:2055::/48": {
"description": "rany.server.network2",
"device": [
"device": {
"2a04:5b81:2055::1": {
"type": "router"
}
]
}
}
]
}
}

View File

@ -1,8 +1,8 @@
{
"route": [
"route": {
"fd96:21ef:a9ba::/48": {
"description": "reddawn.network",
"device": [
"device": {
"fd96:21ef:a9ba::1": {
"type": "router",
"service": [
@ -18,6 +18,7 @@
"fd96:21ef:a9ba::2": {
"type": "router"
}
]
}
}
}
}

View File

@ -1,8 +1,8 @@
{
"route": [
"route": {
"fdfb:1a20:a9bf:1000::7ab8/128": {
"description": "rnb.home.network",
"device": [
"device": {
"fdfb:1a20:a9bf:1000::7ab8": {
"service": [
{
@ -13,22 +13,22 @@
]
},
{
"description": "BunkerFiles - File host and Pastebin"
"description": "BunkerFiles - File host and Pastebin",
"type": "http",
"endpoint": [
{ "port": 8080 }
]
},
{
"description": "rnb's Website"
"type": "http"
"description": "rnb's Website",
"type": "http",
"endpoint": [
{ "port": 80 }
]
}
]
}
]
}
}
]
}
}

View File

@ -1,20 +1,20 @@
{
"route": [
"route": {
"fd9a:1111:98cc::/48": {
"description": "starland.galactic.network",
"device": [
"device": {
"fd9a:1111:98cc::1": {
"type": "router"
}
]
}
},
"fd7e:33d3:de22::/48": {
"description": "starland.solar.network",
"device": [
"device": {
"fd7e:33d3:de22::1": {
"type": "router"
}
]
}
}
]
}
}

View File

@ -1,12 +1,12 @@
{
"route": [
"route": {
"fd98:9fde:b4a2::/48": {
"description": "tdemin.home.network",
"device": [
"device": {
"fd98:9fde:b4a2::1": {
"type": "router"
}
]
}
}
]
}
}

17
test.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
# Primitive testing script to check that the JSONs are valid.
ret=0
while read -r l
do
if ! jq ".route | .[] | .description" < "$l" 2>&1 > /dev/null
then
echo "$l is invalid!" >&2
ret=1
else
echo "$l is valid."
fi
done < <(find "$PWD" -name '*.json' -type f)
exit $ret

View File

@ -1,12 +1,12 @@
{
"route": [
"route": {
"fdd3:5d24:69d3::/48": {
"description": "thooms@v17",
"device": [
"device": {
"fdd3:5d24:69d3::1": {
"type": "router"
}
]
}
}
]
}
}