github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+incompatible/cmds/core/dmesg/dmesg_test.go (about) 1 // Copyright 2016-2017 the u-root Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import ( 8 "os" 9 "testing" 10 11 "github.com/u-root/u-root/pkg/testutil" 12 ) 13 14 func TestDmesg(t *testing.T) { 15 if uid := os.Getuid(); uid != 0 { 16 t.Skipf("test requires root on CircleCI, your uid is %d", uid) 17 } 18 19 cmd := testutil.Command(t) 20 out, err := cmd.Output() 21 if err != nil || len(out) == 0 { 22 t.Fatal(err) 23 } 24 } 25 26 func TestMain(m *testing.M) { 27 testutil.Run(m, main) 28 }