Skip to content

Commit

Permalink
Implement regex update and close #72
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Jan 15, 2022
1 parent fdda917 commit 02de954
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/OSS_SNMP/Platforms/vendor_huawei.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
//
// 'S6720-54C-EI-48S-AC Huawei Versatile Routing Platform Software VRP (R) software,Version 5.170 (S6720 V200R010C00SPC600) Copyright (C) 2007 Huawei Technologies Co., Ltd.'
// https://github.com/opensolutions/OSS_SNMP/issues/59
else if( preg_match( '/^(S\d+\-[A-Z0-9\-]+) Huawei Versatile Routing Platform Software VRP \(R\) software,Version ([0-9\.]+) \((S[0-9]+) [A-Z0-9]+\) Copyright \(C\) 2007 Huawei Technologies.*$/',
else if( preg_match( '/^(S\d+\-[A-Z0-9\-]+)\s+Huawei Versatile Routing Platform Software\s+VRP \(R\) software,Version ([0-9\.]+) \((S[0-9]+) [A-Z0-9]+\)\s+Copyright \(C\) 2007 Huawei Technologies.*$/',
$sysDescr, $matches ) ) {

$this->setVendor( 'Huawei' );
Expand Down
18 changes: 18 additions & 0 deletions tests/Tests/OSS_SNMP/Platforms/HuaweiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,23 @@ public function testHuaweiE() {
$this->assertEquals( $p->getModel(), 'HUAWEICE6870-24S6CQ-EI' );
}

// https://github.com/opensolutions/OSS_SNMP/issues/72
const HUAWEI_F = 'S6720-54C-EI-48S-AC
Huawei Versatile Routing Platform Software
VRP (R) software,Version 5.170 (S6720 V200R010C00SPC600)
Copyright (C) 2007 Huawei Technologies Co., Ltd.';

public function testHuaweiF() {

$p = new TestOSSPlatform( self::HUAWEI_F, '' );

$this->assertEquals( $p->getVendor(), 'Huawei' );
$this->assertEquals( $p->getOs(), 'Huawei Versatile Routing Platform Software VRP' );
$this->assertEquals( $p->getOsVersion(), '5.170' );
$this->assertNull( $p->getOsDate() );
$this->assertEquals( $p->getModel(), 'S6720-54C-EI-48S-AC' );
}



}

0 comments on commit 02de954

Please sign in to comment.