mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-07 12:05:07 -05:00
test: add IPv6 simulation tests
This commit is contained in:
15
test/simulation/015-ipv6
Executable file
15
test/simulation/015-ipv6
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
. ./test.common
|
||||||
|
|
||||||
|
test_start "IPv6 addressing"
|
||||||
|
|
||||||
|
ip_family=6
|
||||||
|
|
||||||
|
run_test || test_fail
|
||||||
|
check_chronyd_exit || test_fail
|
||||||
|
check_source_selection || test_fail
|
||||||
|
check_packet_interval || test_fail
|
||||||
|
check_sync || test_fail
|
||||||
|
|
||||||
|
test_pass
|
||||||
@@ -31,6 +31,17 @@ check_chronyd_exit || test_fail
|
|||||||
check_source_selection || test_fail
|
check_source_selection || test_fail
|
||||||
check_sync || test_fail
|
check_sync || test_fail
|
||||||
|
|
||||||
|
if check_config_h 'FEAT_IPV6 1'; then
|
||||||
|
ip_family=6
|
||||||
|
|
||||||
|
run_test || test_fail
|
||||||
|
check_chronyd_exit || test_fail
|
||||||
|
check_source_selection || test_fail
|
||||||
|
check_sync || test_fail
|
||||||
|
|
||||||
|
ip_family=$default_ip_family
|
||||||
|
fi
|
||||||
|
|
||||||
freq_max_limit=$default_freq_max_limit
|
freq_max_limit=$default_freq_max_limit
|
||||||
base_delay="(+ 1e-4 (* -1 (equal 0.1 from 3) (equal 0.1 to 1)))"
|
base_delay="(+ 1e-4 (* -1 (equal 0.1 from 3) (equal 0.1 to 1)))"
|
||||||
client_peer_options=""
|
client_peer_options=""
|
||||||
|
|||||||
@@ -58,6 +58,21 @@ for client_conf in \
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if check_config_h 'FEAT_IPV6 1'; then
|
||||||
|
server_chronyd_options="-6"
|
||||||
|
client_chronyd_options="-6"
|
||||||
|
ip_family=6
|
||||||
|
|
||||||
|
run_test || test_fail
|
||||||
|
check_chronyd_exit || test_fail
|
||||||
|
check_source_selection || test_fail
|
||||||
|
check_sync || test_fail
|
||||||
|
|
||||||
|
server_chronyd_options=$default_server_chronyd_options
|
||||||
|
client_chronyd_options="-d"
|
||||||
|
ip_family=$default_ip_family
|
||||||
|
fi
|
||||||
|
|
||||||
server_conf+="
|
server_conf+="
|
||||||
server 192.168.123.2 minpoll 1 maxpoll 1 noselect"
|
server 192.168.123.2 minpoll 1 maxpoll 1 noselect"
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,20 @@ check_file_messages " 2 1 .* 4460 " 260 300 log.packets || test_fail
|
|||||||
check_file_messages "." 6 6 ntskeys || test_fail
|
check_file_messages "." 6 6 ntskeys || test_fail
|
||||||
rm -f tmp/measurements.log
|
rm -f tmp/measurements.log
|
||||||
|
|
||||||
|
if check_config_h 'FEAT_IPV6 1'; then
|
||||||
|
ip_family=6
|
||||||
|
|
||||||
|
run_test || test_fail
|
||||||
|
check_chronyd_exit || test_fail
|
||||||
|
check_source_selection || test_fail
|
||||||
|
check_sync || test_fail
|
||||||
|
|
||||||
|
check_file_messages " 2 1 .* 4460 " 260 300 log.packets || test_fail
|
||||||
|
check_file_messages "." 6 6 ntskeys || test_fail
|
||||||
|
|
||||||
|
ip_family=$default_ip_family
|
||||||
|
fi
|
||||||
|
|
||||||
client_conf+="
|
client_conf+="
|
||||||
ntsrefresh 120
|
ntsrefresh 120
|
||||||
ntsdumpdir tmp"
|
ntsdumpdir tmp"
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ default_max_sync_time=210
|
|||||||
default_client_min_mean_out_interval=0.0
|
default_client_min_mean_out_interval=0.0
|
||||||
default_client_max_min_out_interval=inf
|
default_client_max_min_out_interval=inf
|
||||||
|
|
||||||
|
default_ip_family=4
|
||||||
default_cmdmon_unix=1
|
default_cmdmon_unix=1
|
||||||
default_pcap_dumps=0
|
default_pcap_dumps=0
|
||||||
default_dns=0
|
default_dns=0
|
||||||
@@ -190,6 +191,8 @@ get_node_name() {
|
|||||||
|
|
||||||
if [ $dns -ne 0 ]; then
|
if [ $dns -ne 0 ]; then
|
||||||
echo "node$index.net1.clk"
|
echo "node$index.net1.clk"
|
||||||
|
elif [ $ip_family -eq 6 ]; then
|
||||||
|
printf "fc00::123:%x" $index
|
||||||
else
|
else
|
||||||
echo "192.168.123.$index"
|
echo "192.168.123.$index"
|
||||||
fi
|
fi
|
||||||
@@ -472,6 +475,7 @@ run_test() {
|
|||||||
nodes=$(get_chronyd_nodes)
|
nodes=$(get_chronyd_nodes)
|
||||||
[ -n "$chronyc_conf" ] && nodes=$[$nodes + $clients]
|
[ -n "$chronyc_conf" ] && nodes=$[$nodes + $clients]
|
||||||
|
|
||||||
|
export CLKNETSIM_IP_FAMILY=$ip_family
|
||||||
export CLKNETSIM_UNIX_SUBNET=$[$cmdmon_unix != 0 ? 2 : 0]
|
export CLKNETSIM_UNIX_SUBNET=$[$cmdmon_unix != 0 ? 2 : 0]
|
||||||
|
|
||||||
for i in $(seq 1 $nodes); do
|
for i in $(seq 1 $nodes); do
|
||||||
|
|||||||
Reference in New Issue
Block a user