From 520420aa83eda967cdb8b30527886eed5dcec8fe Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Tue, 19 Nov 2019 13:14:45 -0500
Subject: [PATCH 13/37] test: functions: add macro NMCLI_CHECK
Useful for NetworkManager integration tests.
(cherry picked from commit 608f00749967ba71b04c4cbb86f5877382aaee07)
(cherry picked from commit ca41c60bde8897d218e1046fab2549278a3105da)
---
src/tests/functions.at | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/tests/functions.at b/src/tests/functions.at
index f59eef80c348..e79557350558 100644
--- a/src/tests/functions.at
+++ b/src/tests/functions.at
@@ -586,3 +586,9 @@ m4_define([IF_HOST_SUPPORTS_IPV6_RULES], [
IF_HOST_SUPPORTS_IP6TABLES([$1], [$2])
])])
])
+
+m4_define([NMCLI_CHECK], [
+ AT_SKIP_IF([! NS_CMD([nmcli connection show >/dev/null 2>&1])])
+ NS_CHECK([PIPESTATUS0([nmcli $1], [TRIM_WHITESPACE])],
+ [$2], [m4_strip([$3])], [m4_strip([$4])], [$5], [$6])
+])
--
2.23.0