mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-09 08:16:58 +08:00
tests: use jq to test json correctness
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
@@ -41,7 +41,7 @@ apt-get install -y libpam0g-dev liblz4-dev libseccomp-dev \
|
|||||||
libprotobuf-c-dev libtalloc-dev libllhttp-dev protobuf-c-compiler \
|
libprotobuf-c-dev libtalloc-dev libllhttp-dev protobuf-c-compiler \
|
||||||
gperf iperf3 lcov libuid-wrapper libpam-wrapper libnss-wrapper \
|
gperf iperf3 lcov libuid-wrapper libpam-wrapper libnss-wrapper \
|
||||||
libsocket-wrapper gss-ntlmssp haproxy iputils-ping freeradius \
|
libsocket-wrapper gss-ntlmssp haproxy iputils-ping freeradius \
|
||||||
gawk gnutls-bin iproute2 yajl-tools tcpdump ipcalc
|
gawk gnutls-bin iproute2 jq tcpdump ipcalc
|
||||||
# For manpages
|
# For manpages
|
||||||
apt-get install -y ronn
|
apt-get install -y ronn
|
||||||
```
|
```
|
||||||
@@ -58,7 +58,7 @@ yum install -y pam-devel lz4-devel libseccomp-devel \
|
|||||||
jansson-devel liboath-devel protobuf-c-devel libtalloc-devel \
|
jansson-devel liboath-devel protobuf-c-devel libtalloc-devel \
|
||||||
llhttp-devel protobuf-c gperf iperf3 lcov uid_wrapper \
|
llhttp-devel protobuf-c gperf iperf3 lcov uid_wrapper \
|
||||||
pam_wrapper nss_wrapper socket_wrapper gssntlmssp haproxy iputils \
|
pam_wrapper nss_wrapper socket_wrapper gssntlmssp haproxy iputils \
|
||||||
freeradius gawk gnutls-utils iproute yajl tcpdump
|
freeradius gawk gnutls-utils iproute jq tcpdump
|
||||||
# For manpages
|
# For manpages
|
||||||
yum install -y rubygem-ronn-ng
|
yum install -y rubygem-ronn-ng
|
||||||
```
|
```
|
||||||
|
|||||||
16
tests/json
16
tests/json
@@ -92,7 +92,7 @@ if test $? != 0;then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json_verify <${OUTFILE}
|
jq . ${OUTFILE}
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "occtl show users json invalid"
|
echo "occtl show users json invalid"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -104,7 +104,7 @@ if test $? != 0;then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json_verify <${OUTFILE}
|
jq . ${OUTFILE}
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "occtl show users --debug json invalid"
|
echo "occtl show users --debug json invalid"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -116,7 +116,7 @@ if test $? != 0;then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json_verify <${OUTFILE}
|
jq . ${OUTFILE}
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "occtl show user json invalid"
|
echo "occtl show user json invalid"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -128,7 +128,7 @@ if test $? != 0;then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json_verify <${OUTFILE}
|
jq . ${OUTFILE}
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "occtl show user --debug json invalid"
|
echo "occtl show user --debug json invalid"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -140,7 +140,7 @@ if test $? != 0;then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json_verify <${OUTFILE}
|
jq . ${OUTFILE}
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "occtl show status json invalid"
|
echo "occtl show status json invalid"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -152,7 +152,7 @@ if test $? != 0;then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json_verify <${OUTFILE}
|
jq . ${OUTFILE}
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "occtl show status --debug json invalid"
|
echo "occtl show status --debug json invalid"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -164,7 +164,7 @@ if test $? != 0;then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json_verify <${OUTFILE}
|
jq . ${OUTFILE}
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "occtl show session all json invalid"
|
echo "occtl show session all json invalid"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -176,7 +176,7 @@ if test $? != 0;then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json_verify <${OUTFILE}
|
jq . ${OUTFILE}
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "occtl show session all --debug json invalid"
|
echo "occtl show session all --debug json invalid"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user