aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/setup_ttl_test.go
blob: e923c7846f28c81962a74a45fe0e17b868ed3ecb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package kubernetes

import (
	"testing"

	"github.com/mholt/caddy"
)

func TestKubernetesParseTTL(t *testing.T) {
	tests := []struct {
		input       string // Corefile data as string
		expectedTTL uint32 // expected count of defined zones.
		shouldErr   bool
	}{
		{`kubernetes cluster.local {
			ttl 56
		}`, 56, false},
		{`kubernetes cluster.local`, defaultTTL, false},
		{`kubernetes cluster.local {
			ttl -1
		}`, 0, true},
		{`kubernetes cluster.local {
			ttl 3601
		}`, 0, true},
	}

	for i, tc := range tests {
		c := caddy.NewTestController("dns", tc.input)
		k, err := kubernetesParse(c)
		if err != nil && !tc.shouldErr {
			t.Fatalf("Test %d: Expected no error, got %q", i, err)
		}
		if err == nil && tc.shouldErr {
			t.Fatalf("Test %d: Expected error, got none", i)
		}
		if err != nil && tc.shouldErr {
			// input should error
			continue
		}

		if k.ttl != tc.expectedTTL {
			t.Errorf("Test %d: Expected TTl to be %d, got %d", i, tc.expectedTTL, k.ttl)
		}
	}
}
ed/wip-more-reliable'>jarred/wip-more-reliable Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/set-timeout.mjs (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-02-06Make `Stat` functions fastGravatar Jarred Sumner 6-22/+305
2023-02-06bumpGravatar Jarred Sumner 2-1/+18
2023-02-06formattingGravatar Jarred Sumner 2-2/+7
2023-02-06tweaks to generatorGravatar Jarred Sumner 2-415/+167
2023-02-06Mark some things as not configurableGravatar Jarred Sumner 10-185/+1016
2023-02-06Use new bindings for StatGravatar Jarred Sumner 10-161/+505
2023-02-06Fix buildGravatar Jarred Sumner 1-3/+4
2023-02-06Backport https://github.com/WebKit/WebKit/pull/9713Gravatar Jarred Sumner 2-2/+2
2023-02-06Expose Dirent and Stats (#1998)Gravatar Michał Warda 6-1/+40
2023-02-06fix(uWS:capi) uws_req_set_yield typo and uws_res_override_write_offset (#1996)Gravatar Ciro Spaciari 3-6/+7
2023-02-06Add types for node:console and node:perf_hooks (#1982)Gravatar Colin McDonnell 8-153/+1342
2023-02-06mark bindingGravatar Dylan Conway 1-0/+1
2023-02-06Fix URL of wasi-js (#1997)Gravatar Cheng Shao 2-3/+3
2023-02-05speed it up a little moreGravatar Jarred Sumner 4-119/+290
2023-02-05`substringSharingImpl` allocates, do not useGravatar Jarred Sumner 2-57/+27
2023-02-05Faster Buffer.toString("ascii")Gravatar Jarred Sumner 1-8/+35
2023-02-04Bump querystring-es3 (#1988)Gravatar Gaurish Sethia 2-9/+36
2023-02-04Add `isDeepStructEqual` to `node:util`Gravatar Jarred Sumner 1-2/+6
2023-02-03Fixes #1978Gravatar Jarred Sumner 1-3/+7
2023-02-03Implement os.cpus() for Linux (#1977)Gravatar Justin Whear 1-2/+138
2023-02-03Support passing `Date` to `Bun.sleep`Gravatar Jarred Sumner 3-3/+27
2023-02-03Add test for propagating exceptionGravatar Jarred Sumner 3-5/+28
2023-02-03Add missing crypto exportGravatar Jarred Sumner 2-16/+22
2023-02-03Introduce `await Bun.sleep(ms)`Gravatar Jarred Sumner 5-15/+110
2023-02-03Fix types for `Array.fromAsync`Gravatar Ashcon Partovi 1-1/+1
2023-02-03Fix/Update Typescript types (#1972)Gravatar Gaurish Sethia 2-168/+38
2023-02-03fix require("perf_hooks")Gravatar Jarred Sumner 1-0/+1
2023-02-03allow other ArrayBufferView in Buffer functionsGravatar Jarred Sumner 1-6/+6
2023-02-03Make it less flakyGravatar Jarred Sumner 1-1/+1
2023-02-03Run tests on pull requestsGravatar Ashcon Partovi 1-0/+7
2023-02-03Run tests on pushGravatar Ashcon Partovi 1-0/+7
2023-02-03anotherGravatar Dylan Conway 1-1/+1
2023-02-03integers overflowingGravatar Dylan Conway 1-1/+1
2023-02-03Attempt to debug annotations 2Gravatar Ashcon Partovi 1-4/+1
2023-02-03Attempt to debug annotationsGravatar Ashcon Partovi 1-0/+7
2023-02-03Fix console output in bun wiptestGravatar Ashcon Partovi 1-4/+3
2023-02-03Use GitHub action SDKGravatar Ashcon Partovi 4-10/+16