Test suite fails on Fedora 30+ (works on Fedora 29)...hash table behaviour difference?
Building the Fedora realmd package currently succeeds on Fedora 29 and earlier, but fails on Fedora 30 and earlier - using the exact same .src.rpm. The difference is that the test test_update_domain
fails. It expects this output:
[domain/one]\nval=1\nuno = 1\neins = one\n[sssd]\ndomains=one
But gets this:
[domain/one]\nval=1\neins = one\nuno = 1\n[sssd]\ndomains=one
i.e. the expected values are added to the expected section, but in the reverse order. The expected order is the order in which the values are added in the test:
ret = realm_sssd_config_update_domain (test->config, "one", &error,
"uno", "1",
"eins", "one",
NULL);
but the config file that gets written has them the other way around when realmd is built on Fedora 30+, for some reason.
The way this seems to more or less work is the values get put into a g_hash_table
and the values from the hash table are read out again into a RealmIniConfig
instance by various methods in realm-ini-config.c
; the approach there seems to be simply that key+value pairs are read out of the hash table with a g_hash_table_iter
and added to an internal representation of the configuration in whatever order they show up - I, anyway, can't spot any point at which anything in realmd explicitly sorts the values into any particular order, so it seems to be basically expecting that the order in which pairs are added to a hash table is preserved and reproduced when reading from it. I'm assuming that something about hash table behaviour has changed in F30+...