-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
34 lines (24 loc) · 869 Bytes
/
Copy pathDockerfile.test
File metadata and controls
34 lines (24 loc) · 869 Bytes
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
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y dnsutils && rm -rf /var/lib/apt/lists/*
COPY target/debian/*.deb /tmp/
COPY <<'EOF' /test.sh
#!/bin/bash
set -e
echo "Testing SwiftDNS package installation..."
dpkg -i /tmp/*.deb || exit 1
# We need to run a command before the configuration file is created
swiftdns check facebook.com
test -f /etc/swiftdns/config.toml || exit 1
test -f /usr/bin/swiftdns || exit 1
test -f /lib/systemd/system/swiftdns.service || exit 1
# Test basic functionality
swiftdns --help >/dev/null
swiftdns check google.com | grep -q "not blacklisted\|blacklisted"
echo "✅ Package installation test passed!"
echo " ✓ Package installs without errors"
echo " ✓ Configuration file created"
echo " ✓ Binary is functional"
echo " ✓ Systemd service file installed"
EOF
RUN chmod +x /test.sh
CMD ["/test.sh"]