selftest: let realm_to_ip_mappings() return stable (sorted) results
authorStefan Metzmacher <metze@samba.org>
Wed, 11 Mar 2020 15:57:02 +0000 (16:57 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 27 Mar 2020 09:02:38 +0000 (09:02 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
selftest/target/Samba.pm

index b6bf91309cf01158ac0eba2d54050dfb1176d408..50a81ff049075fd2429c9dfb3e96c5ed632e3c8a 100644 (file)
@@ -477,7 +477,8 @@ sub realm_to_ip_mappings
 
        # convert the hashmap to a list of key=value strings, where key is the
        # realm and value is the IP address
-       while (my ($realm, $pdc) = each(%realm_to_pdc_mapping)) {
+       foreach my $realm (sort(keys %realm_to_pdc_mapping)) {
+               my $pdc = $realm_to_pdc_mapping{$realm};
                my $ipaddr = get_ipv4_addr($pdc);
                push(@mapping, "$realm=$ipaddr");
        }