| 
									
										
										
										
											2016-03-18 20:57:35 +00:00
										 |  |  | package core | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-19 14:46:32 +00:00
										 |  |  | /* | 
					
						
							| 
									
										
										
										
											2016-03-18 20:57:35 +00:00
										 |  |  | func TestCaddyStartStop(t *testing.T) { | 
					
						
							| 
									
										
										
										
											2016-04-28 11:07:44 -07:00
										 |  |  | 	corefile := "localhost:1984" | 
					
						
							| 
									
										
										
										
											2016-03-18 20:57:35 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	for i := 0; i < 2; i++ { | 
					
						
							| 
									
										
										
										
											2016-04-28 11:07:44 -07:00
										 |  |  | 		err := Start(CorefileInput{Contents: []byte(corefile)}) | 
					
						
							| 
									
										
										
										
											2016-03-18 20:57:35 +00:00
										 |  |  | 		if err != nil { | 
					
						
							|  |  |  | 			t.Fatalf("Error starting, iteration %d: %v", i, err) | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		client := http.Client{ | 
					
						
							|  |  |  | 			Timeout: time.Duration(2 * time.Second), | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		resp, err := client.Get("http://localhost:1984") | 
					
						
							|  |  |  | 		if err != nil { | 
					
						
							|  |  |  | 			t.Fatalf("Expected GET request to succeed (iteration %d), but it failed: %v", i, err) | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		resp.Body.Close() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		err = Stop() | 
					
						
							|  |  |  | 		if err != nil { | 
					
						
							|  |  |  | 			t.Fatalf("Error stopping, iteration %d: %v", i, err) | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2016-03-19 14:46:32 +00:00
										 |  |  | */ |