summaryrefslogtreecommitdiffstats
path: root/src/vat/main.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-01-18 13:28:22 +0100
committerDamjan Marion <dmarion@me.com>2019-01-20 16:14:24 +0000
commit4d2f86a1ebcfc952080386603354c4767d2c8825 (patch)
treed20ed373877bfbf145d3b7ed0773a0cdbfaee32e /src/vat/main.c
parente67c1d8242fec255e7449fedcbdec5c66bb3f7b2 (diff)
Rework of debian packaging
Change-Id: Ifede85d3af36f3ee6c6f8f92dcf5db0ed8f1bfeb Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vat/main.c')
-rw-r--r--src/vat/main.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/vat/main.c b/src/vat/main.c
index 295ccec2515..a5421140fb3 100644
--- a/src/vat/main.c
+++ b/src/vat/main.c
@@ -15,6 +15,7 @@
#include "vat.h"
#include "plugin.h"
#include <signal.h>
+#include <limits.h>
vat_main_t vat_main;
@@ -283,6 +284,37 @@ setup_signal_handlers (void)
}
}
+static void
+vat_find_plugin_path ()
+{
+ extern char *vat_plugin_path;
+ char *p, path[PATH_MAX];
+ int rv;
+ u8 *s;
+
+ /* find executable path */
+ if ((rv = readlink ("/proc/self/exe", path, PATH_MAX - 1)) == -1)
+ return;
+
+ /* readlink doesn't provide null termination */
+ path[rv] = 0;
+
+ /* strip filename */
+ if ((p = strrchr (path, '/')) == 0)
+ return;
+ *p = 0;
+
+ /* strip bin/ */
+ if ((p = strrchr (path, '/')) == 0)
+ return;
+ *p = 0;
+
+ s = format (0, "%s/lib/" CLIB_TARGET_TRIPLET "/vpp_api_test_plugins:"
+ "%s/lib/vpp_api_test_plugins", path, path);
+ vec_add1 (s, 0);
+ vat_plugin_path = (char *) s;
+}
+
int
main (int argc, char **argv)
{
@@ -309,6 +341,8 @@ main (int argc, char **argv)
vec_validate (vam->cmd_reply, 0);
vec_reset_length (vam->cmd_reply);
+ vat_find_plugin_path ();
+
unformat_init_command_line (a, argv);
while (unformat_check_input (a) != UNFORMAT_END_OF_INPUT)
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
---
metadata:
  version: 0.1
  schema:
    - resources/topology_schemas/2_node_topology.sch.yaml
    - resources/topology_schemas/topology.sch.yaml
  tags: [hw, 2-node]

nodes:
  TG:
    type: TG
    subtype: TREX
    host: "10.32.8.21"
    arch: x86_64
    port: 22
    username: testuser
    password: Csit1234
    interfaces:
      port1:
        # s36-t28-tg1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE.
        mac_address: "3c:fd:fe:ca:e8:28"
        pci_address: "0000:18:00.0"
        ip4_address: "172.16.10.2"
        driver: i40e
        link: link1
        model: Intel-X710
      port2:
        # s36-t28-tg1-c2/p2 - 10GE port2 on Intel NIC x710 4p10GE.
        mac_address: "3c:fd:fe:ca:e8:29"
        pci_address: "0000:18:00.1"
        ip4_address: "172.16.20.2"
        driver: i40e
        link: link2
        model: Intel-X710
      port3:
        # s36-t28-tg1-c2/p3 - 10GE port3 on Intel NIC x710 4p10GE.
        mac_address: "3c:fd:fe:ca:e8:2a"
        pci_address: "0000:18:00.2"
        ip4_address: "172.16.30.2"
        driver: i40e
        link: link3
        model: Intel-X710
      port4:
        # s36-t28-tg1-c2/p4 - 10GE port4 on Intel NIC x710 4p10GE.
        mac_address: "3c:fd:fe:ca:e8:2b"
        pci_address: "0000:18:00.3"
        ip4_address: "172.16.40.2"
        driver: i40e
        link: link4
        model: Intel-X710
      port5:
        # s36-t28-tg1-c4/p1 - 25GE port1 on Intel NIC xxv710 2p25GE.
        mac_address: "3c:fd:fe:cf:69:ec"
        pci_address: "0000:3b:00.0"
        ip4_address: "172.16.50.2"
        driver: i40e
        link: link5
        model: Intel-XXV710
      port6:
        # s36-t28-tg1-c4/p2 - 25GE port2 on Intel NIC xxv710 2p25GE.
        mac_address: "3c:fd:fe:cf:69:ed"
        pci_address: "0000:3b:00.1"
        ip4_address: "172.16.60.2"
        driver: i40e
        link: link6
        model: Intel-XXV710
#      port7:
#        # s36-t28-tg1-c9/p1 - 100GE-port1 ConnectX5-2p100GE.
#        mac_address: "?"
#        pci_address: "0000:5e:00.0"
#        ip4_address: "172.16.70.2"
#        driver: mlx5_core
#        link: link7
#        model: Mellanox-CX556A
#      port8:
#        # s36-t28-tg1-c9/p2 - 100GE-port2 ConnectX5-2p100GE.
#        mac_address: "?"
#        pci_address: "0000:5e:00.1"
#        ip4_address: "172.16.70.1"
#        driver: mlx5_core
#        link: link8
#        model: Mellanox-CX556A
  DUT1:
    type: DUT
    host: "10.32.8.20"
    arch: x86_64
    port: 22
    username: testuser
    password: Csit1234
    uio_driver: vfio-pci
    honeycomb:
      user: admin
      passwd: admin
      port: 8183
      netconf_port: 2831
    interfaces:
      port1:
        # s35-t28-sut1-c2/p1 - 10GE port1 on Intel NIC x710 4p10GE.
        mac_address: "3c:fd:fe:ca:e3:b0"
        pci_address: "0000:18:00.0"
        ip4_address: "172.16.10.1"
        driver: i40e
        link: link1
        model: Intel-X710
      port2:
        # s35-t28-sut1-c2/p2 - 10GE port2 on Intel NIC x710 4p10GE.
        mac_address: "3c:fd:fe:ca:e3:b1"
        pci_address: "0000:18:00.1"
        ip4_address: "172.16.20.1"
        driver: i40e
        link: link2
        model: Intel-X710
      port3:
        # s35-t28-sut1-c2/p3 - 10GE port3 on Intel NIC x710 4p10GE.
        mac_address: "3c:fd:fe:ca:e3:b2"
        pci_address: "0000:18:00.2"
        ip4_address: "172.16.30.1"
        driver: i40e
        link: link3
        model: Intel-X710
      port4:
        # s35-t28-sut1-c2/p4 - 10GE port4 on Intel NIC x710 4p10GE.
        mac_address: "3c:fd:fe:ca:e3:b3"
        pci_address: "0000:18:00.3"
        ip4_address: "172.16.40.1"
        driver: i40e
        link: link4
        model: Intel-X710
      port5:
        # s35-t28-sut1-c2/p1 - 25GE port1 on Intel NIC xxv710 2p25GE.
        mac_address: "3c:fd:fe:dd:d1:90"
        pci_address: "0000:3b:00.0"
        ip4_address: "172.16.50.1"
        driver: i40e
        link: link5
        model: Intel-XXV710
      port6:
        # s35-t28-sut1-c2/p2 - 25GE port2 on Intel NIC xxv710 2p25GE.
        mac_address: "3c:fd:fe:dd:d1:91"
        pci_address: "0000:3b:00.1"
        ip4_address: "172.16.60.1"
        driver: i40e
        link: link6
        model: Intel-XXV710
#      port7:
#        # s35-t28-sut1-c9/p1 - 100GE-port1 ConnectX5-2p100GE.
#        mac_address: "?"
#        pci_address: "0000:5e:00.0"
#        ip4_address: "172.16.70.2"
#        driver: mlx5_core
#        link: link7
#        model: Mellanox-CX556A
#      port8:
#        # s35-t28-sut1-c9/p2 - 100GE-port2 ConnectX5-2p100GE.
#        mac_address: "?"
#        pci_address: "0000:5e:00.1"
#        ip4_address: "172.16.70.1"
#        driver: mlx5_core
#        link: link8
#        model: Mellanox-CX556A