mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-29 01:04:15 -04:00 
			
		
		
		
	* Update Caddy to 1.0.1, and update import path This fix updates caddy to 1.0.1 and also updates the import path to github.com/caddyserver/caddy This fix fixes 2959 Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Also update plugin.cfg Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update and bump zplugin.go Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
		
			
				
	
	
		
			52 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package reload
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/caddyserver/caddy"
 | |
| )
 | |
| 
 | |
| func TestSetupReload(t *testing.T) {
 | |
| 	c := caddy.NewTestController("dns", `reload`)
 | |
| 	if err := setup(c); err != nil {
 | |
| 		t.Fatalf("Expected no errors, but got: %v", err)
 | |
| 	}
 | |
| 
 | |
| 	c = caddy.NewTestController("dns", `reload 10s`)
 | |
| 	if err := setup(c); err != nil {
 | |
| 		t.Fatalf("Expected no errors, but got: %v", err)
 | |
| 	}
 | |
| 
 | |
| 	c = caddy.NewTestController("dns", `reload 10s 2s`)
 | |
| 	if err := setup(c); err != nil {
 | |
| 		t.Fatalf("Expected no errors, but got: %v", err)
 | |
| 	}
 | |
| 
 | |
| 	c = caddy.NewTestController("dns", `reload foo`)
 | |
| 	if err := setup(c); err == nil {
 | |
| 		t.Fatalf("Expected errors, but got: %v", err)
 | |
| 	}
 | |
| 
 | |
| 	c = caddy.NewTestController("dns", `reload 10s foo`)
 | |
| 	if err := setup(c); err == nil {
 | |
| 		t.Fatalf("Expected errors, but got: %v", err)
 | |
| 	}
 | |
| 
 | |
| 	c = caddy.NewTestController("dns", `reload 10s 5s foo`)
 | |
| 	if err := setup(c); err == nil {
 | |
| 		t.Fatalf("Expected errors, but got: %v", err)
 | |
| 	}
 | |
| 	c = caddy.NewTestController("dns", `reload 1s`)
 | |
| 	if err := setup(c); err == nil {
 | |
| 		t.Fatalf("Expected errors, but got: %v", err)
 | |
| 	}
 | |
| 	c = caddy.NewTestController("dns", `reload 0s`)
 | |
| 	if err := setup(c); err == nil {
 | |
| 		t.Fatalf("Expected errors, but got: %v", err)
 | |
| 	}
 | |
| 	c = caddy.NewTestController("dns", `reload 3s 0.5s`)
 | |
| 	if err := setup(c); err == nil {
 | |
| 		t.Fatalf("Expected errors, but got: %v", err)
 | |
| 	}
 | |
| }
 |