Dispatcher test additions

This commit is contained in:
Olof hagsand 2021-10-14 08:58:35 +02:00
parent d2d3454177
commit 93d1149925
7 changed files with 72 additions and 16 deletions

View file

@ -91,7 +91,8 @@ APPSRC += clixon_util_path.c
APPSRC += clixon_util_datastore.c
APPSRC += clixon_util_regexp.c
APPSRC += clixon_util_socket.c
APPSRC += clixon_util_validate.c
APPSRC += clixon_util_validate.c
APPSRC += clixon_util_dispatcher.c
APPSRC += clixon_netconf_ssh_callhome.c
APPSRC += clixon_netconf_ssh_callhome_client.c
ifdef with_restconf
@ -149,6 +150,9 @@ clixon_util_socket: clixon_util_socket.c $(LIBDEPS)
clixon_util_validate: clixon_util_validate.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ -l clixon_backend -o $@ $(LIBS)
clixon_util_dispatcher: clixon_util_dispatcher.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ -l clixon_backend -o $@ $(LIBS)
ifdef with_restconf
clixon_util_stream: clixon_util_stream.c $(LIBDEPS)
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -lcurl -o $@
@ -163,7 +167,7 @@ endif
distclean: clean
rm -f Makefile *~ .depend
install:
install: $(APPS)
install -d -m 0755 $(DESTDIR)$(bindir)
install -m 0755 $(INSTALLFLAGS) $(APPS) $(DESTDIR)$(bindir)

Binary file not shown.

View file

@ -126,7 +126,7 @@ main(int argc,
int len;
char *buf = NULL;
int ret;
FILE *fp = stdin; /* unless overriden by argv[1] */
FILE *fp = stdin; /* unless overriden by -f */
char *yang_file_dir = NULL;
yang_stmt *yspec = NULL;
char *xpath = NULL;
@ -169,7 +169,7 @@ main(int argc,
case 'f': /* XML file */
filename = optarg;
if ((fp = fopen(filename, "r")) == NULL){
clicon_err(OE_UNIX, errno, "open(%s)", argv[1]);
clicon_err(OE_UNIX, errno, "fopen(%s)", optarg);
goto done;
}
break;