static int
test_invalid_vdev_flag(void)
{
+#ifdef RTE_EXEC_ENV_BSDAPP
+ /* BSD target doesn't support prefixes at this point, and we also need to
+ * run another primary process here */
+ const char * prefix = no_shconf;
+#else
+ const char * prefix = "--file-prefix=vdev";
+#endif
+
/* Test with invalid vdev option */
- const char *vdevinval[] = {prgname, "--file-prefix=vdev","-n", "1",
+ const char *vdevinval[] = {prgname, prefix, "-n", "1",
"-c", "1", vdev, "eth_dummy"};
/* Test with valid vdev option */
- const char *vdevval1[] = {prgname, "--file-prefix=vdev", "-n", "1",
+ const char *vdevval1[] = {prgname, prefix, "-n", "1",
"-c", "1", vdev, "eth_ring0"};
- const char *vdevval2[] = {prgname, "--file-prefix=vdev", "-n", "1",
+ const char *vdevval2[] = {prgname, prefix, "-n", "1",
"-c", "1", vdev, "eth_ring0,args=test"};
- const char *vdevval3[] = {prgname, "--file-prefix=vdev", "-n", "1",
+ const char *vdevval3[] = {prgname, prefix, "-n", "1",
"-c", "1", vdev, "eth_ring0,nodeaction=r1:0:CREATE"};
if (launch_proc(vdevinval) == 0) {
#define launch_proc(ARGV) process_dup(ARGV, \
sizeof(ARGV)/(sizeof(ARGV[0])), __func__)
+#ifdef RTE_EXEC_ENV_LINUXAPP
static char*
get_current_prefix(char * prefix, int size)
{
return prefix;
}
+#endif
/*
* This function is called in the primary i.e. main test, to spawn off secondary
int ret = 0;
char coremask[10];
+#ifdef RTE_EXEC_ENV_LINUXAPP
char tmp[PATH_MAX] = {0};
char prefix[PATH_MAX] = {0};
get_current_prefix(tmp, sizeof(tmp));
snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+#else
+ const char *prefix = "";
+#endif
/* good case, using secondary */
const char *argv1[] = {
prgname, "-c", coremask, "--proc-type=ERROR",
prefix
};
+#ifdef RTE_EXEC_ENV_LINUXAPP
/* bad case, using invalid file prefix */
const char *argv4[] = {
prgname, "-c", coremask, "--proc-type=secondary",
"--file-prefix=ERROR"
};
+#endif
snprintf(coremask, sizeof(coremask), "%x", \
(1 << rte_get_master_lcore()));
ret |= launch_proc(argv2);
ret |= !(launch_proc(argv3));
+#ifdef RTE_EXEC_ENV_LINUXAPP
ret |= !(launch_proc(argv4));
+#endif
return ret;
}