github.com/vmware/govmomi@v0.37.1/vmdk/import_test.go (about) 1 /* 2 Copyright (c) 2017 VMware, Inc. All Rights Reserved. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 nSee the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package vmdk 18 19 import ( 20 "os" 21 "testing" 22 ) 23 24 func TestDiskInfo(t *testing.T) { 25 di, err := stat("../govc/test/images/ttylinux-pc_i486-16.1-disk1.vmdk") 26 if err != nil { 27 if os.IsNotExist(err) { 28 t.SkipNow() 29 } 30 t.Fatal(err) 31 } 32 33 _, err = di.ovf() 34 if err != nil { 35 t.Fatal(err) 36 } 37 } 38 39 func TestDiskInvalid(t *testing.T) { 40 _, err := stat("import_test.go") 41 if err != ErrInvalidFormat { 42 t.Errorf("expected ErrInvalidFormat: %s", err) 43 } 44 }