mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-22 16:13:31 +01:00
0c8f8a62c7
In some operation systems, the sys info contains invalid characters. In this patch try to keep the original fallback logic but filter out the cases when the character is invalid.
25 lines
447 B
Go
25 lines
447 B
Go
package system
|
|
|
|
import (
|
|
"testing"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func Test_sysInfoMac(t *testing.T) {
|
|
t.Skip("skipping darwin test")
|
|
serialNum, prodName, manufacturer := sysInfo()
|
|
if serialNum == "" {
|
|
t.Errorf("serialNum is empty")
|
|
}
|
|
|
|
if prodName == "" {
|
|
t.Errorf("prodName is empty")
|
|
}
|
|
|
|
if manufacturer == "" {
|
|
t.Errorf("manufacturer is empty")
|
|
}
|
|
log.Infof("Mac sys info: %s, %s, %s", serialNum, prodName, manufacturer)
|
|
}
|