mirror of
				https://github.com/coredns/coredns.git
				synced 2025-11-03 18:53:13 -05:00 
			
		
		
		
	
		
			
	
	
		
			25 lines
		
	
	
		
			458 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			25 lines
		
	
	
		
			458 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								package test
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import "testing"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								func TestBind_FilterAll(t *testing.T) {
							 | 
						||
| 
								 | 
							
									t.Parallel()
							 | 
						||
| 
								 | 
							
									corefile := `.:0 {
							 | 
						||
| 
								 | 
							
								        bind 127.0.0.1 {
							 | 
						||
| 
								 | 
							
								            except 127.0.0.1
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								        trace
							 | 
						||
| 
								 | 
							
								        loop
							 | 
						||
| 
								 | 
							
								        whoami
							 | 
						||
| 
								 | 
							
								    }`
							 | 
						||
| 
								 | 
							
									inst, err := CoreDNSServer(corefile)
							 | 
						||
| 
								 | 
							
									if inst != nil {
							 | 
						||
| 
								 | 
							
										CoreDNSServerStop(inst)
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
									if err == nil {
							 | 
						||
| 
								 | 
							
										t.Log("server started; stopping immediately")
							 | 
						||
| 
								 | 
							
									} else {
							 | 
						||
| 
								 | 
							
										t.Logf("server failed to start as expected without listeners: %v", err)
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
								}
							 |