github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+incompatible/integration/generic-tests/basic_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 !race
     6  
     7  package integration
     8  
     9  import (
    10  	"testing"
    11  
    12  	"github.com/u-root/u-root/pkg/vmtest"
    13  )
    14  
    15  func TestScript(t *testing.T) {
    16  	q, cleanup := vmtest.QEMUTest(t, &vmtest.Options{
    17  		Name: "ShellScript",
    18  		TestCmds: []string{
    19  			"echo HELLO WORLD",
    20  			"shutdown -h",
    21  		},
    22  	})
    23  	defer cleanup()
    24  
    25  	if err := q.Expect("HELLO WORLD"); err != nil {
    26  		t.Fatal(`expected "HELLO WORLD", got error: `, err)
    27  	}
    28  }