Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
DO: updated to new driver spec; updated integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Hazlett <[email protected]>
  • Loading branch information
ehazlett committed Mar 17, 2015
1 parent 5403171 commit da3da50
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 86 deletions.
67 changes: 0 additions & 67 deletions drivers/digitalocean/digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package digitalocean
import (
"fmt"
"io/ioutil"
"os/exec"
"path/filepath"
"time"

Expand Down Expand Up @@ -241,23 +240,6 @@ func (d *Driver) Create() error {
return err
}

log.Info("Configuring Machine...")

log.Debugf("Setting hostname: %s", d.MachineName)
cmd, err := d.GetSSHCommand(fmt.Sprintf(
"echo \"127.0.0.1 %s\" | sudo tee -a /etc/hosts && sudo hostname %s && echo \"%s\" | sudo tee /etc/hostname",
d.MachineName,
d.MachineName,
d.MachineName,
))

if err != nil {
return err
}
if err := cmd.Run(); err != nil {
return err
}

return nil
}

Expand Down Expand Up @@ -354,59 +336,10 @@ func (d *Driver) Kill() error {
return err
}

func (d *Driver) StartDocker() error {
log.Debug("Starting Docker...")

cmd, err := d.GetSSHCommand("sudo service docker start")
if err != nil {
return err
}
if err := cmd.Run(); err != nil {
return err
}

return nil
}

func (d *Driver) StopDocker() error {
log.Debug("Stopping Docker...")

cmd, err := d.GetSSHCommand("sudo service docker stop")
if err != nil {
return err
}
if err := cmd.Run(); err != nil {
return err
}

return nil
}

func (d *Driver) GetDockerConfigDir() string {
return dockerConfigDir
}

func (d *Driver) Upgrade() error {
log.Debugf("Upgrading Docker")

cmd, err := d.GetSSHCommand("sudo apt-get update && sudo apt-get install --upgrade lxc-docker")
if err != nil {
return err

}
if err := cmd.Run(); err != nil {
return err

}

return cmd.Run()
}

func (d *Driver) GetSSHCommand(args ...string) (*exec.Cmd, error) {
cmd := ssh.GetSSHCommand(d.IPAddress, 22, "root", d.sshKeyPath(), args...)
return cmd, nil
}

func (d *Driver) getClient() *godo.Client {
t := &oauth.Transport{
Token: &oauth.Token{AccessToken: d.AccessToken},
Expand Down
2 changes: 0 additions & 2 deletions test/integration/driver-amazonec2.bats
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
@test "$DRIVER: machine should show stopped after kill" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Stopped"* ]]
}

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

Expand Down
2 changes: 0 additions & 2 deletions test/integration/driver-azure.bats
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
@test "$DRIVER: machine should show stopped after kill" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Stopped"* ]]
}

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

Expand Down
2 changes: 0 additions & 2 deletions test/integration/driver-digitalocean.bats
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
@test "$DRIVER: machine should show stopped after kill" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Stopped"* ]]
}

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

Expand Down
2 changes: 0 additions & 2 deletions test/integration/driver-google.bats
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
@test "$DRIVER: machine should show stopped after kill" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Stopped"* ]]
}

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

Expand Down
2 changes: 0 additions & 2 deletions test/integration/driver-hyperv.bats
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
@test "$DRIVER: machine should show stopped after kill" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Stopped"* ]]
}

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

Expand Down
1 change: 0 additions & 1 deletion test/integration/driver-rackspace.bats
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
@test "$DRIVER: machine should show running after restart" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Running"* ]]
}

Expand Down
2 changes: 0 additions & 2 deletions test/integration/driver-softlayer.bats
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
@test "$DRIVER: machine should show stopped after kill" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Stopped"* ]]
}

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

Expand Down
2 changes: 0 additions & 2 deletions test/integration/driver-virtualbox.bats
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ function setup() {
@test "$DRIVER: machine should show stopped after kill" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Stopped"* ]]
}

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

Expand Down
2 changes: 0 additions & 2 deletions test/integration/driver-vmwarefusion.bats
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ function setup() {
@test "$DRIVER: machine should show stopped after kill" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Stopped"* ]]
}

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

Expand Down
2 changes: 0 additions & 2 deletions test/integration/driver-vmwarevcloudair.bats
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export MACHINE_STORAGE_PATH=/tmp/machine-bats-test-$DRIVER
@test "$DRIVER: machine should show stopped after kill" {
run machine ls
[ "$status" -eq 0 ]
[[ ${lines[1]} == *"$NAME"* ]]
[[ ${lines[1]} == *"Stopped"* ]]
}

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

Expand Down

0 comments on commit da3da50

Please sign in to comment.