integration/server_test.go/TestCreateNumberUsername == integration-cli/docker_cli_run_test.go/TestUserByID
integration/server_test.go/TestRmi == integration-cli/docker_cli_images_test.go/TestCLIImageTagRemove
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
| ... | ... |
@@ -2,7 +2,6 @@ package docker |
| 2 | 2 |
|
| 3 | 3 |
import ( |
| 4 | 4 |
"bytes" |
| 5 |
- "strings" |
|
| 6 | 5 |
"testing" |
| 7 | 6 |
"time" |
| 8 | 7 |
|
| ... | ... |
@@ -23,18 +22,6 @@ func TestCreateNumberHostname(t *testing.T) {
|
| 23 | 23 |
createTestContainer(eng, config, t) |
| 24 | 24 |
} |
| 25 | 25 |
|
| 26 |
-func TestCreateNumberUsername(t *testing.T) {
|
|
| 27 |
- eng := NewTestEngine(t) |
|
| 28 |
- defer mkDaemonFromEngine(eng, t).Nuke() |
|
| 29 |
- |
|
| 30 |
- config, _, _, err := runconfig.Parse([]string{"-u", "1002", unitTestImageID, "echo test"}, nil)
|
|
| 31 |
- if err != nil {
|
|
| 32 |
- t.Fatal(err) |
|
| 33 |
- } |
|
| 34 |
- |
|
| 35 |
- createTestContainer(eng, config, t) |
|
| 36 |
-} |
|
| 37 |
- |
|
| 38 | 26 |
func TestCommit(t *testing.T) {
|
| 39 | 27 |
eng := NewTestEngine(t) |
| 40 | 28 |
defer mkDaemonFromEngine(eng, t).Nuke() |
| ... | ... |
@@ -271,92 +258,6 @@ func TestRunWithTooLowMemoryLimit(t *testing.T) {
|
| 271 | 271 |
} |
| 272 | 272 |
} |
| 273 | 273 |
|
| 274 |
-func TestRmi(t *testing.T) {
|
|
| 275 |
- eng := NewTestEngine(t) |
|
| 276 |
- srv := mkServerFromEngine(eng, t) |
|
| 277 |
- defer mkDaemonFromEngine(eng, t).Nuke() |
|
| 278 |
- |
|
| 279 |
- initialImages := getAllImages(eng, t) |
|
| 280 |
- |
|
| 281 |
- config, hostConfig, _, err := runconfig.Parse([]string{unitTestImageID, "echo", "test"}, nil)
|
|
| 282 |
- if err != nil {
|
|
| 283 |
- t.Fatal(err) |
|
| 284 |
- } |
|
| 285 |
- |
|
| 286 |
- containerID := createTestContainer(eng, config, t) |
|
| 287 |
- |
|
| 288 |
- //To remove |
|
| 289 |
- job := eng.Job("start", containerID)
|
|
| 290 |
- if err := job.ImportEnv(hostConfig); err != nil {
|
|
| 291 |
- t.Fatal(err) |
|
| 292 |
- } |
|
| 293 |
- if err := job.Run(); err != nil {
|
|
| 294 |
- t.Fatal(err) |
|
| 295 |
- } |
|
| 296 |
- |
|
| 297 |
- if err := eng.Job("wait", containerID).Run(); err != nil {
|
|
| 298 |
- t.Fatal(err) |
|
| 299 |
- } |
|
| 300 |
- |
|
| 301 |
- job = eng.Job("commit", containerID)
|
|
| 302 |
- job.Setenv("repo", "test")
|
|
| 303 |
- var outputBuffer = bytes.NewBuffer(nil) |
|
| 304 |
- job.Stdout.Add(outputBuffer) |
|
| 305 |
- if err := job.Run(); err != nil {
|
|
| 306 |
- t.Fatal(err) |
|
| 307 |
- } |
|
| 308 |
- |
|
| 309 |
- if err := eng.Job("tag", engine.Tail(outputBuffer, 1), "test", "0.1").Run(); err != nil {
|
|
| 310 |
- t.Fatal(err) |
|
| 311 |
- } |
|
| 312 |
- |
|
| 313 |
- containerID = createTestContainer(eng, config, t) |
|
| 314 |
- |
|
| 315 |
- //To remove |
|
| 316 |
- job = eng.Job("start", containerID)
|
|
| 317 |
- if err := job.ImportEnv(hostConfig); err != nil {
|
|
| 318 |
- t.Fatal(err) |
|
| 319 |
- } |
|
| 320 |
- if err := job.Run(); err != nil {
|
|
| 321 |
- t.Fatal(err) |
|
| 322 |
- } |
|
| 323 |
- |
|
| 324 |
- if err := eng.Job("wait", containerID).Run(); err != nil {
|
|
| 325 |
- t.Fatal(err) |
|
| 326 |
- } |
|
| 327 |
- |
|
| 328 |
- job = eng.Job("commit", containerID)
|
|
| 329 |
- job.Setenv("repo", "test")
|
|
| 330 |
- if err := job.Run(); err != nil {
|
|
| 331 |
- t.Fatal(err) |
|
| 332 |
- } |
|
| 333 |
- |
|
| 334 |
- images := getAllImages(eng, t) |
|
| 335 |
- |
|
| 336 |
- if images.Len()-initialImages.Len() != 2 {
|
|
| 337 |
- t.Fatalf("Expected 2 new images, found %d.", images.Len()-initialImages.Len())
|
|
| 338 |
- } |
|
| 339 |
- |
|
| 340 |
- if err = srv.DeleteImage(engine.Tail(outputBuffer, 1), engine.NewTable("", 0), true, false, false); err != nil {
|
|
| 341 |
- t.Fatal(err) |
|
| 342 |
- } |
|
| 343 |
- |
|
| 344 |
- images = getAllImages(eng, t) |
|
| 345 |
- |
|
| 346 |
- if images.Len()-initialImages.Len() != 1 {
|
|
| 347 |
- t.Fatalf("Expected 1 new image, found %d.", images.Len()-initialImages.Len())
|
|
| 348 |
- } |
|
| 349 |
- |
|
| 350 |
- for _, image := range images.Data {
|
|
| 351 |
- if strings.Contains(unitTestImageID, image.Get("Id")) {
|
|
| 352 |
- continue |
|
| 353 |
- } |
|
| 354 |
- if image.GetList("RepoTags")[0] == "<none>:<none>" {
|
|
| 355 |
- t.Fatalf("Expected tagged image, got untagged one.")
|
|
| 356 |
- } |
|
| 357 |
- } |
|
| 358 |
-} |
|
| 359 |
- |
|
| 360 | 274 |
func TestImagesFilter(t *testing.T) {
|
| 361 | 275 |
eng := NewTestEngine(t) |
| 362 | 276 |
defer nuke(mkDaemonFromEngine(eng, t)) |