mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	
		
			
	
	
		
			18 lines
		
	
	
		
			362 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			362 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								package test
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import "testing"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// Start test server that has metrics enabled. Then tear it down again.
							 | 
						||
| 
								 | 
							
								func TestMetricsServer(t *testing.T) {
							 | 
						||
| 
								 | 
							
									corefile := `.:0 {
							 | 
						||
| 
								 | 
							
									chaos CoreDNS-001 miek@miek.nl
							 | 
						||
| 
								 | 
							
									prometheus localhost:0
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								`
							 | 
						||
| 
								 | 
							
									srv, err := CoreDNSServer(corefile)
							 | 
						||
| 
								 | 
							
									if err != nil {
							 | 
						||
| 
								 | 
							
										t.Fatalf("Could not get CoreDNS serving instance: %s", err)
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
									defer srv.Stop()
							 | 
						||
| 
								 | 
							
								}
							 |