Skip to content

Commit 4bed990

Browse files
committed
New features and updates
1 parent 729bb53 commit 4bed990

File tree

27 files changed

+1097
-65
lines changed

27 files changed

+1097
-65
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: End-to-end testing with running resolver
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: E2E Tests
7+
shell: bash
8+
run: |
9+
cd ${{ github.workspace }}/test-e2e || exit 1
10+
./run.sh 127.0.0.1 10053 yourdomain.com
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Run PolarDNS server
2+
inputs:
3+
resolver:
4+
required: false
5+
type: string
6+
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Create network
11+
if: ${{ inputs.resolver }}
12+
shell: bash
13+
run: |
14+
docker network create --driver=bridge --subnet=192.168.0.0/16 polardns
15+
16+
- name: Connect target
17+
if: ${{ inputs.resolver }}
18+
shell: bash
19+
run: |
20+
docker network connect --ip "192.168.0.10" polardns ${{ inputs.resolver }}
21+
22+
- name: Run PolarDNS in docker
23+
if: ${{ inputs.resolver }}
24+
shell: bash
25+
run: |
26+
docker run -d --name polardns --network polardns --ip "192.168.0.11" oryxlabs/polardns:latest
27+
sleep 5
28+
29+
- name: Sanity check
30+
shell: bash
31+
run: |
32+
echo "--------------------"
33+
echo "Sanity check"
34+
echo "--------------------"
35+
output=$(dig @127.0.0.1 -p 10053 always.yourdomain.com A +noedns)
36+
37+
echo "output: $output"
38+
echo $output | grep "NOERROR"
39+
echo $output | grep "2.3.4.5"
40+

.github/workflows/e2e-bind9.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: E2E BIND 9
2+
on:
3+
- workflow_dispatch
4+
jobs:
5+
tests:
6+
runs-on: [linux, self-hosted]
7+
strategy:
8+
matrix:
9+
version:
10+
- "9.18"
11+
- "9.20"
12+
- "9.21"
13+
steps:
14+
- name: Configure AWS credentials
15+
uses: aws-actions/configure-aws-credentials@v1
16+
with:
17+
aws-access-key-id: ${{ secrets.DEV_AWS_ECR_ACCESS_KEY_ID }}
18+
aws-secret-access-key: ${{ secrets.DEV_AWS_ECR_SECRET_ACCESS_KEY }}
19+
aws-region: ${{ secrets.DEV_AWS_ECR_REGION }}
20+
21+
- name: Login to Amazon ECR
22+
id: login-ecr
23+
uses: aws-actions/amazon-ecr-login@v1
24+
25+
- uses: actions/checkout@v4
26+
27+
- name: Run Bind9
28+
run: |
29+
docker run --name bind9 -p 10053:53/udp -p 10053:53/tcp -d -v "${{ github.workspace }}/.github/workflows/e2e-bind9/named.conf:/etc/bind/named.conf" internetsystemsconsortium/bind9:${{ matrix.version }}
30+
sleep 10
31+
32+
- name: Run PolarDNS
33+
uses: ./.github/actions/run-polardns
34+
with:
35+
resolver: bind9
36+
37+
- name: Run E2E tests
38+
uses: ./.github/actions/e2e-tests
39+
continue-on-error: true
40+
41+
- name: Upload test results
42+
uses: actions/upload-artifact@v3
43+
with:
44+
path: e2e-tests
45+
name: e2e-test-results-bind9-${{ matrix.version }}
46+
if-no-files-found: ignore
47+
48+
- name: Debug running containers
49+
if: failure()
50+
run: |
51+
docker ps -a
52+
53+
- name: Debug Bind9
54+
if: failure()
55+
run: |
56+
docker logs Bind9
57+
58+
- name: Debug PolarDNS
59+
run: |
60+
docker logs polardns
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
options {
2+
directory "/var/cache/bind";
3+
4+
// forwarders {
5+
// 0.0.0.0;
6+
// };
7+
8+
//========================================================================
9+
// If BIND logs error messages about the root key being expired,
10+
// you will need to update your keys. See https://www.isc.org/bind-keys
11+
//=========================================================================
12+
dnssec-validation no;
13+
14+
listen-on-v6 { any; };
15+
16+
recursion yes;
17+
allow-query { any; };
18+
};
19+
20+
zone "yourdomain.com" {
21+
type forward;
22+
forward only;
23+
forwarders { 192.168.0.11; };
24+
};

.github/workflows/e2e-coredns.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: E2E CoreDNS
2+
on:
3+
- workflow_dispatch
4+
jobs:
5+
tests:
6+
runs-on: [linux, self-hosted]
7+
strategy:
8+
matrix:
9+
version:
10+
- "1.12.0"
11+
steps:
12+
- name: Configure AWS credentials
13+
uses: aws-actions/configure-aws-credentials@v1
14+
with:
15+
aws-access-key-id: ${{ secrets.DEV_AWS_ECR_ACCESS_KEY_ID }}
16+
aws-secret-access-key: ${{ secrets.DEV_AWS_ECR_SECRET_ACCESS_KEY }}
17+
aws-region: ${{ secrets.DEV_AWS_ECR_REGION }}
18+
19+
- name: Login to Amazon ECR
20+
id: login-ecr
21+
uses: aws-actions/amazon-ecr-login@v1
22+
23+
- uses: actions/checkout@v4
24+
25+
- name: Run CoreDNS
26+
run: |
27+
docker run --name coredns -p 10053:53/udp -p 10053:53/tcp -d -v "${{ github.workspace }}/.github/workflows/e2e-coredns/Corefile:/Corefile" coredns/coredns:${{ matrix.version }}
28+
sleep 10
29+
30+
- name: Run PolarDNS
31+
uses: ./.github/actions/run-polardns
32+
with:
33+
resolver: coredns
34+
35+
- name: Run E2E tests
36+
uses: ./.github/actions/e2e-tests
37+
continue-on-error: true
38+
39+
- name: Upload test results
40+
uses: actions/upload-artifact@v3
41+
with:
42+
path: e2e-tests
43+
name: e2e-test-results-coredns-${{ matrix.version }}
44+
if-no-files-found: ignore
45+
46+
- name: Debug running containers
47+
if: failure()
48+
run: |
49+
docker ps -a
50+
51+
- name: Debug CoreDNS
52+
if: failure()
53+
run: |
54+
docker logs coredns
55+
56+
- name: Debug PolarDNS
57+
run: |
58+
docker logs polardns
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
yourdomain.com {
2+
log
3+
forward . 192.168.0.11:53
4+
cache
5+
whoami
6+
}

.github/workflows/e2e-dnsmasq.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: E2E Dnsmasq
2+
on:
3+
- workflow_dispatch
4+
jobs:
5+
tests:
6+
runs-on: [linux, self-hosted]
7+
strategy:
8+
matrix:
9+
version:
10+
- "latest"
11+
steps:
12+
- name: Configure AWS credentials
13+
uses: aws-actions/configure-aws-credentials@v1
14+
with:
15+
aws-access-key-id: ${{ secrets.DEV_AWS_ECR_ACCESS_KEY_ID }}
16+
aws-secret-access-key: ${{ secrets.DEV_AWS_ECR_SECRET_ACCESS_KEY }}
17+
aws-region: ${{ secrets.DEV_AWS_ECR_REGION }}
18+
19+
- name: Login to Amazon ECR
20+
id: login-ecr
21+
uses: aws-actions/amazon-ecr-login@v1
22+
23+
- uses: actions/checkout@v4
24+
25+
- name: Run Dnsmasq
26+
run: |
27+
docker run --name dnsmasq -p 10053:53/udp -p 10053:53/tcp -d -e "DNS1=192.168.0.11" -e "DNS2=192.168.0.11" dockurr/dnsmasq:${{ matrix.version }}
28+
sleep 10
29+
30+
- name: Run PolarDNS
31+
uses: ./.github/actions/run-polardns
32+
with:
33+
resolver: dnsmasq
34+
35+
- name: Run E2E tests
36+
uses: ./.github/actions/e2e-tests
37+
continue-on-error: true
38+
39+
- name: Upload test results
40+
uses: actions/upload-artifact@v3
41+
with:
42+
path: e2e-tests
43+
name: e2e-test-results-dnsmasq-${{ matrix.version }}
44+
if-no-files-found: ignore
45+
46+
- name: Debug running containers
47+
if: failure()
48+
run: |
49+
docker ps -a
50+
51+
- name: Debug Dnsmasq
52+
if: failure()
53+
run: |
54+
docker logs dnsmasq
55+
56+
- name: Debug PolarDNS
57+
run: |
58+
docker logs polardns

.github/workflows/e2e-knot-v5.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: E2E Knot Resolver v5
2+
on:
3+
- workflow_dispatch
4+
jobs:
5+
tests:
6+
runs-on: [linux, self-hosted]
7+
strategy:
8+
matrix:
9+
version:
10+
- "v5.7.4"
11+
steps:
12+
- name: Configure AWS credentials
13+
uses: aws-actions/configure-aws-credentials@v1
14+
with:
15+
aws-access-key-id: ${{ secrets.DEV_AWS_ECR_ACCESS_KEY_ID }}
16+
aws-secret-access-key: ${{ secrets.DEV_AWS_ECR_SECRET_ACCESS_KEY }}
17+
aws-region: ${{ secrets.DEV_AWS_ECR_REGION }}
18+
19+
- name: Login to Amazon ECR
20+
id: login-ecr
21+
uses: aws-actions/amazon-ecr-login@v1
22+
23+
- uses: actions/checkout@v4
24+
25+
- name: Run Knot
26+
run: |
27+
docker run --name knot-resolver -p 10053:53/udp -p 10053:53/tcp -d -v "${{ github.workspace }}/.github/workflows/e2e-knot/kresd.conf:/etc/knot-resolver/kresd.conf" cznic/knot-resolver:${{ matrix.version }} -nc /etc/knot-resolver/kresd.conf
28+
sleep 10
29+
30+
- name: Run PolarDNS
31+
uses: ./.github/actions/run-polardns
32+
with:
33+
resolver: knot-resolver
34+
35+
- name: Run E2E tests
36+
uses: ./.github/actions/e2e-tests
37+
continue-on-error: true
38+
39+
- name: Upload test results
40+
uses: actions/upload-artifact@v3
41+
with:
42+
path: e2e-tests
43+
name: e2e-test-results-knot5-${{ matrix.version }}
44+
if-no-files-found: ignore
45+
46+
- name: Debug running containers
47+
if: failure()
48+
run: |
49+
docker ps -a
50+
51+
- name: Debug Knot
52+
if: failure()
53+
run: |
54+
docker logs knot-resolver
55+
56+
- name: Debug PolarDNS
57+
run: |
58+
docker logs polardns

.github/workflows/e2e-knot-v6.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: E2E Knot Resolver v6
2+
on:
3+
- workflow_dispatch
4+
jobs:
5+
tests:
6+
runs-on: [linux, self-hosted]
7+
strategy:
8+
matrix:
9+
version:
10+
- "6"
11+
- "latest"
12+
steps:
13+
- name: Configure AWS credentials
14+
uses: aws-actions/configure-aws-credentials@v1
15+
with:
16+
aws-access-key-id: ${{ secrets.DEV_AWS_ECR_ACCESS_KEY_ID }}
17+
aws-secret-access-key: ${{ secrets.DEV_AWS_ECR_SECRET_ACCESS_KEY }}
18+
aws-region: ${{ secrets.DEV_AWS_ECR_REGION }}
19+
20+
- name: Login to Amazon ECR
21+
id: login-ecr
22+
uses: aws-actions/amazon-ecr-login@v1
23+
24+
- uses: actions/checkout@v4
25+
26+
- name: Run Knot
27+
run: |
28+
docker run --name knot-resolver -p 10053:53/udp -p 10053:53/tcp -d -v "${{ github.workspace }}/.github/workflows/e2e-knot/config.yaml:/etc/knot-resolver/config.yaml" cznic/knot-resolver:${{ matrix.version }} -c /etc/knot-resolver/config.yaml
29+
sleep 10
30+
31+
- name: Run PolarDNS
32+
uses: ./.github/actions/run-polardns
33+
with:
34+
resolver: knot-resolver
35+
36+
- name: Run E2E tests
37+
uses: ./.github/actions/e2e-tests
38+
continue-on-error: true
39+
40+
- name: Upload test results
41+
uses: actions/upload-artifact@v3
42+
with:
43+
path: e2e-tests
44+
name: e2e-test-results-knot6-${{ matrix.version }}
45+
if-no-files-found: ignore
46+
47+
- name: Debug running containers
48+
if: failure()
49+
run: |
50+
docker ps -a
51+
52+
- name: Debug Knot
53+
if: failure()
54+
run: |
55+
docker logs knot-resolver
56+
57+
- name: Debug PolarDNS
58+
run: |
59+
docker logs polardns

0 commit comments

Comments
 (0)