Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/device/huawei/huawei.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
`|Error(?:\[\d+\])?:\s*(?P<msg>.+?)` +
`)`
passwordExpression = `(\r\n|^)Password:$`
passwordErrorExpression = `.*Error: Username or password error\.\r\n$|.*Authentication fail(\x00\r\n)?$|Error: The password is invalid.\r\n$`
passwordErrorExpression = `.*(Error: Username or password error\.\r\n|.*Authentication fail(\x00\r\n)?|Error: The password is invalid.\r\n|Error: Authentication fail)(\r\n|$)`
pagerExpression = `(?P<store>(\r\n|\n))? ---- More ----$`
)

Expand Down
7 changes: 7 additions & 0 deletions pkg/device/huawei/huawei_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ func TestHuaweiQuestion(t *testing.T) {
}
testutils.ExprTester(t, errorCases, questionExpression)
}

func TestAuthError(t *testing.T) {
errorCases := [][]byte{
[]byte("\r\nError: Authentication fail\r\n"), // followed by User interface con0 is available, console
}
testutils.ExprTester(t, errorCases, passwordErrorExpression)
}
Loading