test: use SPDX tags in 6WIND copyrighted files
[dpdk.git] / test / test / test_eal_flags.c
index 594d79d..37c42ef 100644 (file)
@@ -1,36 +1,8 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- *   Copyright(c) 2014 6WIND S.A.
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2014 Intel Corporation.
+ * Copyright(c) 2014 6WIND S.A.
  */
+
 #include <stdio.h>
 
 #include "test.h"
 
 #include "process.h"
 
-#ifdef RTE_LIBRTE_XEN_DOM0
-#define DEFAULT_MEM_SIZE "30"
-#else
 #define DEFAULT_MEM_SIZE "18"
-#endif
 #define mp_flag "--proc-type=secondary"
 #define no_hpet "--no-hpet"
 #define no_huge "--no-huge"
@@ -809,72 +777,6 @@ test_no_huge_flag(void)
        return 0;
 }
 
-#ifdef RTE_LIBRTE_XEN_DOM0
-static int
-test_dom0_misc_flags(void)
-{
-       char prefix[PATH_MAX], tmp[PATH_MAX];
-
-       if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
-               printf("Error - unable to get current prefix!\n");
-               return -1;
-       }
-       snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
-
-       /* check that some general flags don't prevent things from working.
-        * All cases, apart from the first, app should run.
-        * No further testing of output done.
-        */
-       /* sanity check - failure with invalid option */
-       const char *argv0[] = {prgname, prefix, mp_flag, "-c", "1", "--invalid-opt"};
-
-       /* With --no-pci */
-       const char *argv1[] = {prgname, prefix, mp_flag, "-c", "1", "--no-pci"};
-       /* With -v */
-       const char *argv2[] = {prgname, prefix, mp_flag, "-c", "1", "-v"};
-       /* With valid --syslog */
-       const char *argv3[] = {prgname, prefix, mp_flag, "-c", "1",
-                       "--syslog", "syslog"};
-       /* With empty --syslog (should fail) */
-       const char *argv4[] = {prgname, prefix, mp_flag, "-c", "1", "--syslog"};
-       /* With invalid --syslog */
-       const char *argv5[] = {prgname, prefix, mp_flag, "-c", "1", "--syslog", "error"};
-       /* With no-sh-conf */
-       const char *argv6[] = {prgname, "-c", "1", "-n", "2", "-m", "20",
-                       "--no-shconf", "--file-prefix=noshconf" };
-
-       if (launch_proc(argv0) == 0) {
-               printf("Error - process ran ok with invalid flag\n");
-               return -1;
-       }
-       if (launch_proc(argv1) != 0) {
-               printf("Error - process did not run ok with --no-pci flag\n");
-               return -1;
-       }
-       if (launch_proc(argv2) != 0) {
-               printf("Error - process did not run ok with -v flag\n");
-               return -1;
-       }
-       if (launch_proc(argv3) != 0) {
-               printf("Error - process did not run ok with --syslog flag\n");
-               return -1;
-       }
-       if (launch_proc(argv4) == 0) {
-               printf("Error - process run ok with empty --syslog flag\n");
-               return -1;
-       }
-       if (launch_proc(argv5) == 0) {
-               printf("Error - process run ok with invalid --syslog flag\n");
-               return -1;
-       }
-       if (launch_proc(argv6) != 0) {
-               printf("Error - process did not run ok with --no-shconf flag\n");
-               return -1;
-       }
-
-       return 0;
-}
-#else
 static int
 test_misc_flags(void)
 {
@@ -1061,7 +963,6 @@ test_misc_flags(void)
        }
        return 0;
 }
-#endif
 
 static int
 test_file_prefix(void)
@@ -1098,9 +999,6 @@ test_file_prefix(void)
                printf("Error - unable to get current prefix!\n");
                return -1;
        }
-#ifdef RTE_LIBRTE_XEN_DOM0
-       return 0;
-#endif
 
        /* check if files for current prefix are present */
        if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {
@@ -1299,9 +1197,6 @@ test_memory_flags(void)
                printf("Error - process failed with valid -m flag!\n");
                return -1;
        }
-#ifdef RTE_LIBRTE_XEN_DOM0
-       return 0;
-#endif
        if (launch_proc(argv2) == 0) {
                printf("Error - process run ok with invalid (zero) --socket-mem!\n");
                return -1;
@@ -1427,11 +1322,7 @@ test_eal_flags(void)
                return ret;
        }
 
-#ifdef RTE_LIBRTE_XEN_DOM0
-       ret = test_dom0_misc_flags();
-#else
        ret = test_misc_flags();
-#endif
        if (ret < 0) {
                printf("Error in test_misc_flags()");
                return ret;