2014-02-20 23:20:54 -05:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
2014-02-24 11:26:51 -05:00
|
|
|
"os/exec"
|
2014-02-20 23:20:54 -05:00
|
|
|
)
|
|
|
|
|
2014-04-06 18:31:49 -04:00
|
|
|
const VMWARE_WS_VERSION = "10"
|
|
|
|
|
2014-02-20 23:20:54 -05:00
|
|
|
// Workstation10Driver is a driver that can run VMware Workstation 10
|
2014-04-06 18:31:49 -04:00
|
|
|
// installations.
|
2014-02-20 23:20:54 -05:00
|
|
|
|
|
|
|
type Workstation10Driver struct {
|
2014-02-24 11:26:51 -05:00
|
|
|
Workstation9Driver
|
2014-02-20 23:20:54 -05:00
|
|
|
}
|
|
|
|
|
2020-09-17 04:38:33 -04:00
|
|
|
func NewWorkstation10Driver(config *SSHConfig) Driver {
|
|
|
|
return &Workstation10Driver{
|
|
|
|
Workstation9Driver: Workstation9Driver{
|
|
|
|
SSHConfig: config,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-16 20:38:42 -04:00
|
|
|
func (d *Workstation10Driver) Clone(dst, src string, linked bool) error {
|
|
|
|
|
|
|
|
var cloneType string
|
|
|
|
if linked {
|
|
|
|
cloneType = "linked"
|
|
|
|
} else {
|
|
|
|
cloneType = "full"
|
|
|
|
}
|
|
|
|
|
2014-02-24 11:26:51 -05:00
|
|
|
cmd := exec.Command(d.Workstation9Driver.VmrunPath,
|
|
|
|
"-T", "ws",
|
|
|
|
"clone", src, dst,
|
2018-06-16 20:38:42 -04:00
|
|
|
cloneType)
|
2014-02-20 23:20:54 -05:00
|
|
|
|
2014-02-24 11:26:51 -05:00
|
|
|
if _, _, err := runAndLog(cmd); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2014-02-20 23:20:54 -05:00
|
|
|
|
2014-02-24 11:26:51 -05:00
|
|
|
return nil
|
2014-02-20 23:20:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Workstation10Driver) Verify() error {
|
2014-02-24 11:26:51 -05:00
|
|
|
if err := d.Workstation9Driver.Verify(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2014-02-20 23:20:54 -05:00
|
|
|
|
2014-04-06 18:31:49 -04:00
|
|
|
return workstationVerifyVersion(VMWARE_WS_VERSION)
|
2014-02-20 23:20:54 -05:00
|
|
|
}
|
2017-04-13 18:39:55 -04:00
|
|
|
|
|
|
|
func (d *Workstation10Driver) GetVmwareDriver() VmwareDriver {
|
|
|
|
return d.Workstation9Driver.VmwareDriver
|
|
|
|
}
|