virCommand(ToString) now provides the functionality internally so we
don't have to keep the string-munging function around.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tests/testutils.c | 51 -----------------------------------------------
tests/testutils.h | 2 --
2 files changed, 53 deletions(-)
diff --git a/tests/testutils.c b/tests/testutils.c
index 8734790457..6b104405f7 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -854,57 +854,6 @@ int virTestMain(int argc,
}
-/*
- * @cmdset contains a list of command line args, eg
- *
- * "/usr/sbin/iptables --table filter --insert INPUT --in-interface virbr0
--protocol tcp --destination-port 53 --jump ACCEPT
- * /usr/sbin/iptables --table filter --insert INPUT --in-interface virbr0 --protocol udp
--destination-port 53 --jump ACCEPT
- * /usr/sbin/iptables --table filter --insert FORWARD --in-interface virbr0 --jump
REJECT
- * /usr/sbin/iptables --table filter --insert FORWARD --out-interface virbr0 --jump
REJECT
- * /usr/sbin/iptables --table filter --insert FORWARD --in-interface virbr0
--out-interface virbr0 --jump ACCEPT"
- *
- * And we're munging it in-place to strip the path component
- * of the command line, to produce
- *
- * "iptables --table filter --insert INPUT --in-interface virbr0 --protocol tcp
--destination-port 53 --jump ACCEPT
- * iptables --table filter --insert INPUT --in-interface virbr0 --protocol udp
--destination-port 53 --jump ACCEPT
- * iptables --table filter --insert FORWARD --in-interface virbr0 --jump REJECT
- * iptables --table filter --insert FORWARD --out-interface virbr0 --jump REJECT
- * iptables --table filter --insert FORWARD --in-interface virbr0 --out-interface virbr0
--jump ACCEPT"
- */
-void virTestClearCommandPath(char *cmdset)
-{
- size_t offset = 0;
- char *lineStart = cmdset;
- char *lineEnd = strchr(lineStart, '\n');
-
- while (lineStart) {
- char *dirsep;
- char *movestart;
- size_t movelen;
- dirsep = strchr(lineStart, ' ');
- if (dirsep) {
- while (dirsep > lineStart && *dirsep != '/')
- dirsep--;
- if (*dirsep == '/')
- dirsep++;
- movestart = dirsep;
- } else {
- movestart = lineStart;
- }
- movelen = lineEnd ? lineEnd - movestart : strlen(movestart);
-
- if (movelen) {
- memmove(cmdset + offset, movestart, movelen + 1);
- offset += movelen + 1;
- }
- lineStart = lineEnd ? lineEnd + 1 : NULL;
- lineEnd = lineStart ? strchr(lineStart, '\n') : NULL;
- }
- cmdset[offset] = '\0';
-}
-
-
virCapsPtr virTestGenericCapsInit(void)
{
g_autoptr(virCaps) caps = NULL;
diff --git a/tests/testutils.h b/tests/testutils.h
index ff5c98a078..4a49c1ca65 100644
--- a/tests/testutils.h
+++ b/tests/testutils.h
@@ -46,8 +46,6 @@ char *virTestLoadFilePath(const char *p, ...)
virJSONValuePtr virTestLoadFileJSON(const char *p, ...)
G_GNUC_NULL_TERMINATED;
-void virTestClearCommandPath(char *cmdset);
-
int virTestDifference(FILE *stream,
const char *expect,
const char *actual);
--
2.30.2