create_test.go 616 B

12345678910111213141516171819202122232425
  1. package uvm
  2. import (
  3. "testing"
  4. )
  5. // Unit tests for negative testing of input to uvm.Create()
  6. func TestCreateBadBootFilesPath(t *testing.T) {
  7. opts := NewDefaultOptionsLCOW(t.Name(), "")
  8. opts.BootFilesPath = `c:\does\not\exist\I\hope`
  9. _, err := CreateLCOW(opts)
  10. if err == nil || err.Error() != `kernel: 'c:\does\not\exist\I\hope\kernel' not found` {
  11. t.Fatal(err)
  12. }
  13. }
  14. func TestCreateWCOWBadLayerFolders(t *testing.T) {
  15. opts := NewDefaultOptionsWCOW(t.Name(), "")
  16. _, err := CreateWCOW(opts)
  17. if err == nil || (err != nil && err.Error() != `at least 2 LayerFolders must be supplied`) {
  18. t.Fatal(err)
  19. }
  20. }