github.com/shaardie/u-root@v4.0.1-0.20190127173353-f24a1c26aa2e+incompatible/integration/io_test.go (about)

     1  // Copyright 2018 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  // +build amd64
     6  
     7  package integration
     8  
     9  import (
    10  	"testing"
    11  )
    12  
    13  // TestIO tests the string "UART TEST" is written to the serial port on 0x3f8.
    14  func TestIO(t *testing.T) {
    15  	// TODO: support arm
    16  	if TestArch() != "amd64" {
    17  		t.Skipf("test not supported on %s", TestArch())
    18  	}
    19  
    20  	// Create the CPIO and start QEMU.
    21  	q, cleanup := QEMUTest(t, &Options{
    22  		Cmds: []string{
    23  			"github.com/u-root/u-root/integration/testcmd/io/uinit",
    24  			"github.com/u-root/u-root/cmds/init",
    25  			"github.com/u-root/u-root/cmds/io",
    26  		},
    27  	})
    28  	defer cleanup()
    29  
    30  	if err := q.Expect("UART TEST"); err != nil {
    31  		t.Fatal(`expected "UART TEST", got error: `, err)
    32  	}
    33  }