...

Source file src/github.com/Microsoft/hcsshim/internal/uvm/create_test.go

Documentation: github.com/Microsoft/hcsshim/internal/uvm

     1  //go:build windows
     2  
     3  package uvm
     4  
     5  import (
     6  	"context"
     7  	"fmt"
     8  	"testing"
     9  )
    10  
    11  // Unit tests for negative testing of input to uvm.Create()
    12  
    13  func TestCreateBadBootFilesPath(t *testing.T) {
    14  	opts := NewDefaultOptionsLCOW(t.Name(), "")
    15  	opts.BootFilesPath = `c:\does\not\exist\I\hope`
    16  
    17  	_, err := CreateLCOW(context.Background(), opts)
    18  	if err == nil || err.Error() != `kernel: 'c:\does\not\exist\I\hope\kernel' not found` {
    19  		t.Fatal(err)
    20  	}
    21  }
    22  
    23  func TestCreateWCOWBadLayerFolders(t *testing.T) {
    24  	opts := NewDefaultOptionsWCOW(t.Name(), "")
    25  	_, err := CreateWCOW(context.Background(), opts)
    26  	errMsg := fmt.Sprintf("%s: %s", errBadUVMOpts, "at least 2 LayerFolders must be supplied")
    27  	if err == nil || (err != nil && err.Error() != errMsg) {
    28  		t.Fatal(err)
    29  	}
    30  }
    31  

View as plain text