This commit is contained in:
sm
2017-05-12 13:33:21 -07:00
commit 68cd4b57da
2 changed files with 41 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package hmm
import "testing"
func TestIPs(t *testing.T) {
{
s := "Failed password for root from 43.229.53.57 port 62954 ssh2"
ip := ParseIP(s)
if ip == "" {
t.Fatalf("didn't find ip, should have")
}
}
{
s := "Oct 10 12:35:46 impa sshd[13226]: Received disconnect from 116.31.116.6 port 58923:11: [preauth]"
ip := ParseIP(s)
if ip != "" {
t.Fatalf("found ip, shouldn't have")
}
}
}