VRP FDB table correctly parsed on some CE switches (#11766)

* vrp FDB table corrected on CE switches

* sleep 5 in snmpsim to run tests.

* 6 seconds wait when snmpsim.fork is called from bootstrap

* rollback in Snmpsim Class

* Update bootstrap.php
This commit is contained in:
PipoCanaja
2020-06-08 06:32:15 +02:00
committed by GitHub
parent 147ba0f00d
commit ea2928babd
2 changed files with 5 additions and 2 deletions

View File

@@ -22,7 +22,10 @@ if (!empty($fdbPort_table)) {
// Collect data and populate $insert
foreach ($fdbPort_table as $mac => $data) {
foreach ($data[$data_oid] as $vlan => $basePort) {
$ifIndex=$basePort[0];
$ifIndex=reset($basePort); // $baseport can be ['' => '119'] or ['0' => '119']
if (! $ifIndex) {
continue;
}
$port = get_port_by_index_cache($device['device_id'], $ifIndex);
$port_id = $port['port_id'];
$mac_address = implode(array_map('zeropad', explode(':', $mac)));

View File

@@ -44,7 +44,7 @@ ini_set('display_errors', 1);
$snmpsim = new Snmpsim('127.1.6.2', 1162, null);
if (getenv('SNMPSIM')) {
$snmpsim->fork();
$snmpsim->fork(6);
// make PHP hold on a reference to $snmpsim so it doesn't get destructed
register_shutdown_function(function (Snmpsim $ss) {