gopkg.in/hugelgupf/u-root.v4@v4.0.0-20180831060141-1d761fb73d50/integration/kexec_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  package integration
     6  
     7  import (
     8  	"testing"
     9  )
    10  
    11  // TestMountKExec runs an init which mounts a filesystem and kexecs a kernel.
    12  func TestMountKExec(t *testing.T) {
    13  	// Create the CPIO and start QEMU.
    14  	tmpDir, q := testWithQEMU(t, "kexec", []string{})
    15  	defer cleanup(t, tmpDir, q)
    16  
    17  	if err := q.Expect("KEXECCOUNTER=0"); err != nil {
    18  		t.Fatal(err)
    19  	}
    20  	if err := q.Expect("KEXECCOUNTER=1"); err != nil {
    21  		t.Fatal(err)
    22  	}
    23  }