Fix Ruijie network device detection (#1168)
This commit is contained in:
@@ -165,6 +165,11 @@ test("detectVendorFromSshVersion recognizes legacy Huawei VRP dash banner", () =
|
||||
assert.equal(detectVendorFromSshVersion("SSH-2.0--"), "huawei");
|
||||
});
|
||||
|
||||
test("detectVendorFromSshVersion recognizes Ruijie RGOS banner", () => {
|
||||
assert.equal(detectVendorFromSshVersion("RGOS_SSH"), "ruijie");
|
||||
assert.equal(detectVendorFromSshVersion("SSH-2.0-RGOS_SSH"), "ruijie");
|
||||
});
|
||||
|
||||
test("shouldProbeSessionCwd allows the probe on a plain Linux host", () => {
|
||||
assert.equal(
|
||||
shouldProbeSessionCwd({ isNetworkDevice: false, remoteSshVersion: "OpenSSH_9.6" }),
|
||||
|
||||
@@ -34,6 +34,7 @@ export const NETWORK_DEVICE_OPTIONS = [
|
||||
'fortinet',
|
||||
'paloalto',
|
||||
'zyxel',
|
||||
'ruijie',
|
||||
] as const;
|
||||
|
||||
export type NetworkDeviceVendor = typeof NETWORK_DEVICE_OPTIONS[number];
|
||||
@@ -118,6 +119,9 @@ export const detectVendorFromSshVersion = (softwareVersion?: string): '' | Netwo
|
||||
// ZyXEL ZyWALL
|
||||
if (/^Zyxel\s*SSH/i.test(s)) return 'zyxel';
|
||||
|
||||
// Ruijie RGOS
|
||||
if (/^RGOS_SSH\b/i.test(s)) return 'ruijie';
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user