Skip to content

Commit da3da50

Browse files
committed
DO: updated to new driver spec; updated integration tests
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
1 parent 5403171 commit da3da50

11 files changed

+0
-86
lines changed

drivers/digitalocean/digitalocean.go

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package digitalocean
33
import (
44
"fmt"
55
"io/ioutil"
6-
"os/exec"
76
"path/filepath"
87
"time"
98

@@ -241,23 +240,6 @@ func (d *Driver) Create() error {
241240
return err
242241
}
243242

244-
log.Info("Configuring Machine...")
245-
246-
log.Debugf("Setting hostname: %s", d.MachineName)
247-
cmd, err := d.GetSSHCommand(fmt.Sprintf(
248-
"echo \"127.0.0.1 %s\" | sudo tee -a /etc/hosts && sudo hostname %s && echo \"%s\" | sudo tee /etc/hostname",
249-
d.MachineName,
250-
d.MachineName,
251-
d.MachineName,
252-
))
253-
254-
if err != nil {
255-
return err
256-
}
257-
if err := cmd.Run(); err != nil {
258-
return err
259-
}
260-
261243
return nil
262244
}
263245

@@ -354,59 +336,10 @@ func (d *Driver) Kill() error {
354336
return err
355337
}
356338

357-
func (d *Driver) StartDocker() error {
358-
log.Debug("Starting Docker...")
359-
360-
cmd, err := d.GetSSHCommand("sudo service docker start")
361-
if err != nil {
362-
return err
363-
}
364-
if err := cmd.Run(); err != nil {
365-
return err
366-
}
367-
368-
return nil
369-
}
370-
371-
func (d *Driver) StopDocker() error {
372-
log.Debug("Stopping Docker...")
373-
374-
cmd, err := d.GetSSHCommand("sudo service docker stop")
375-
if err != nil {
376-
return err
377-
}
378-
if err := cmd.Run(); err != nil {
379-
return err
380-
}
381-
382-
return nil
383-
}
384-
385339
func (d *Driver) GetDockerConfigDir() string {
386340
return dockerConfigDir
387341
}
388342

389-
func (d *Driver) Upgrade() error {
390-
log.Debugf("Upgrading Docker")
391-
392-
cmd, err := d.GetSSHCommand("sudo apt-get update && sudo apt-get install --upgrade lxc-docker")
393-
if err != nil {
394-
return err
395-
396-
}
397-
if err := cmd.Run(); err != nil {
398-
return err
399-
400-
}
401-
402-
return cmd.Run()
403-
}
404-
405-
func (d *Driver) GetSSHCommand(args ...string) (*exec.Cmd, error) {
406-
cmd := ssh.GetSSHCommand(d.IPAddress, 22, "root", d.sshKeyPath(), args...)
407-
return cmd, nil
408-
}
409-
410343
func (d *Driver) getClient() *godo.Client {
411344
t := &oauth.Transport{
412345
Token: &oauth.Token{AccessToken: d.AccessToken},

test/integration/driver-amazonec2.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
7878
@test "$DRIVER: machine should show stopped after kill" {
7979
run machine ls
8080
[ "$status" -eq 0 ]
81-
[[ ${lines[1]} == *"$NAME"* ]]
8281
[[ ${lines[1]} == *"Stopped"* ]]
8382
}
8483

@@ -90,7 +89,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
9089
@test "$DRIVER: machine should show running after restart" {
9190
run machine ls
9291
[ "$status" -eq 0 ]
93-
[[ ${lines[1]} == *"$NAME"* ]]
9492
[[ ${lines[1]} == *"Running"* ]]
9593
}
9694

test/integration/driver-azure.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
7878
@test "$DRIVER: machine should show stopped after kill" {
7979
run machine ls
8080
[ "$status" -eq 0 ]
81-
[[ ${lines[1]} == *"$NAME"* ]]
8281
[[ ${lines[1]} == *"Stopped"* ]]
8382
}
8483

@@ -90,7 +89,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
9089
@test "$DRIVER: machine should show running after restart" {
9190
run machine ls
9291
[ "$status" -eq 0 ]
93-
[[ ${lines[1]} == *"$NAME"* ]]
9492
[[ ${lines[1]} == *"Running"* ]]
9593
}
9694

test/integration/driver-digitalocean.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
7878
@test "$DRIVER: machine should show stopped after kill" {
7979
run machine ls
8080
[ "$status" -eq 0 ]
81-
[[ ${lines[1]} == *"$NAME"* ]]
8281
[[ ${lines[1]} == *"Stopped"* ]]
8382
}
8483

@@ -90,7 +89,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
9089
@test "$DRIVER: machine should show running after restart" {
9190
run machine ls
9291
[ "$status" -eq 0 ]
93-
[[ ${lines[1]} == *"$NAME"* ]]
9492
[[ ${lines[1]} == *"Running"* ]]
9593
}
9694

test/integration/driver-google.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
7878
@test "$DRIVER: machine should show stopped after kill" {
7979
run machine ls
8080
[ "$status" -eq 0 ]
81-
[[ ${lines[1]} == *"$NAME"* ]]
8281
[[ ${lines[1]} == *"Stopped"* ]]
8382
}
8483

@@ -90,7 +89,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
9089
@test "$DRIVER: machine should show running after restart" {
9190
run machine ls
9291
[ "$status" -eq 0 ]
93-
[[ ${lines[1]} == *"$NAME"* ]]
9492
[[ ${lines[1]} == *"Running"* ]]
9593
}
9694

test/integration/driver-hyperv.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
7878
@test "$DRIVER: machine should show stopped after kill" {
7979
run machine ls
8080
[ "$status" -eq 0 ]
81-
[[ ${lines[1]} == *"$NAME"* ]]
8281
[[ ${lines[1]} == *"Stopped"* ]]
8382
}
8483

@@ -90,7 +89,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
9089
@test "$DRIVER: machine should show running after restart" {
9190
run machine ls
9291
[ "$status" -eq 0 ]
93-
[[ ${lines[1]} == *"$NAME"* ]]
9492
[[ ${lines[1]} == *"Running"* ]]
9593
}
9694

test/integration/driver-rackspace.bats

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
6767
@test "$DRIVER: machine should show running after restart" {
6868
run machine ls
6969
[ "$status" -eq 0 ]
70-
[[ ${lines[1]} == *"$NAME"* ]]
7170
[[ ${lines[1]} == *"Running"* ]]
7271
}
7372

test/integration/driver-softlayer.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
7878
@test "$DRIVER: machine should show stopped after kill" {
7979
run machine ls
8080
[ "$status" -eq 0 ]
81-
[[ ${lines[1]} == *"$NAME"* ]]
8281
[[ ${lines[1]} == *"Stopped"* ]]
8382
}
8483

@@ -90,7 +89,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
9089
@test "$DRIVER: machine should show running after restart" {
9190
run machine ls
9291
[ "$status" -eq 0 ]
93-
[[ ${lines[1]} == *"$NAME"* ]]
9492
[[ ${lines[1]} == *"Running"* ]]
9593
}
9694

test/integration/driver-virtualbox.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ function setup() {
9393
@test "$DRIVER: machine should show stopped after kill" {
9494
run machine ls
9595
[ "$status" -eq 0 ]
96-
[[ ${lines[1]} == *"$NAME"* ]]
9796
[[ ${lines[1]} == *"Stopped"* ]]
9897
}
9998

@@ -105,7 +104,6 @@ function setup() {
105104
@test "$DRIVER: machine should show running after restart" {
106105
run machine ls
107106
[ "$status" -eq 0 ]
108-
[[ ${lines[1]} == *"$NAME"* ]]
109107
[[ ${lines[1]} == *"Running"* ]]
110108
}
111109

test/integration/driver-vmwarefusion.bats

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ function setup() {
8383
@test "$DRIVER: machine should show stopped after kill" {
8484
run machine ls
8585
[ "$status" -eq 0 ]
86-
[[ ${lines[1]} == *"$NAME"* ]]
8786
[[ ${lines[1]} == *"Stopped"* ]]
8887
}
8988

@@ -95,7 +94,6 @@ function setup() {
9594
@test "$DRIVER: machine should show running after restart" {
9695
run machine ls
9796
[ "$status" -eq 0 ]
98-
[[ ${lines[1]} == *"$NAME"* ]]
9997
[[ ${lines[1]} == *"Running"* ]]
10098
}
10199

0 commit comments

Comments
 (0)