Browse code

variable names

shin- authored on 2013/04/02 23:13:42
Showing 1 changed files
... ...
@@ -281,7 +281,7 @@ func TestRestore(t *testing.T) {
281 281
 	defer runtime1.Destroy(container1)
282 282
 
283 283
 	// Create a second container meant to be killed
284
-	container1_1, err := runtime1.Create(&Config{
284
+	container2, err := runtime1.Create(&Config{
285 285
 		Image:     GetTestImage(runtime1).Id,
286 286
 		Cmd:       []string{"/bin/cat"},
287 287
 		OpenStdin: true,
... ...
@@ -290,23 +290,23 @@ func TestRestore(t *testing.T) {
290 290
 	if err != nil {
291 291
 		t.Fatal(err)
292 292
 	}
293
-	defer runtime1.Destroy(container1_1)
293
+	defer runtime1.Destroy(container2)
294 294
 
295 295
 	// Start the container non blocking
296
-	if err := container1_1.Start(); err != nil {
296
+	if err := container2.Start(); err != nil {
297 297
 		t.Fatal(err)
298 298
 	}
299 299
 
300
-	if !container1_1.State.Running {
301
-		t.Fatalf("Container %v should appear as running but isn't", container1_1.Id)
300
+	if !container2.State.Running {
301
+		t.Fatalf("Container %v should appear as running but isn't", container2.Id)
302 302
 	}
303 303
 
304 304
 	// Simulate a crash/manual quit of dockerd: process dies, states stays 'Running'
305
-	if err := container1_1.Stop(); err != nil {
305
+	if err := container2.Stop(); err != nil {
306 306
 		t.Fatalf("Could not stop container: %v", err)
307 307
 	}
308 308
 
309
-	container1_1.State.Running = true
309
+	container2.State.Running = true
310 310
 
311 311
 	if len(runtime1.List()) != 2 {
312 312
 		t.Errorf("Expected 2 container, %v found", len(runtime1.List()))
... ...
@@ -315,8 +315,8 @@ func TestRestore(t *testing.T) {
315 315
 		t.Fatal(err)
316 316
 	}
317 317
 
318
-	if !container1_1.State.Running {
319
-		t.Fatalf("Container %v should appear as running but isn't", container1_1.Id)
318
+	if !container2.State.Running {
319
+		t.Fatalf("Container %v should appear as running but isn't", container2.Id)
320 320
 	}
321 321
 
322 322
 	// Here are are simulating a docker restart - that is, reloading all containers
... ...
@@ -339,11 +339,11 @@ func TestRestore(t *testing.T) {
339 339
 	if runningCount != 0 {
340 340
 		t.Fatalf("Expected 0 container alive, %d found", runningCount)
341 341
 	}
342
-	container2 := runtime2.Get(container1.Id)
343
-	if container2 == nil {
342
+	container3 := runtime2.Get(container1.Id)
343
+	if container3 == nil {
344 344
 		t.Fatal("Unable to Get container")
345 345
 	}
346
-	if err := container2.Run(); err != nil {
346
+	if err := container3.Run(); err != nil {
347 347
 		t.Fatal(err)
348 348
 	}
349 349
 }