コード例 #1
0
int main(int argc, char **argv) {
        test_table(address_family_boolean, ADDRESS_FAMILY_BOOLEAN);
        test_table(bond_ad_select, NETDEV_BOND_AD_SELECT);
        test_table(bond_arp_all_targets, NETDEV_BOND_ARP_ALL_TARGETS);
        test_table(bond_arp_validate, NETDEV_BOND_ARP_VALIDATE);
        test_table(bond_fail_over_mac, NETDEV_BOND_FAIL_OVER_MAC);
        test_table(bond_lacp_rate, NETDEV_BOND_LACP_RATE);
        test_table(bond_mode, NETDEV_BOND_MODE);
        test_table(bond_primary_reselect, NETDEV_BOND_PRIMARY_RESELECT);
        test_table(bond_xmit_hash_policy, NETDEV_BOND_XMIT_HASH_POLICY);
        test_table(dhcp6_message_status, DHCP6_STATUS);
        test_table_sparse(dhcp6_message_type, DHCP6_MESSAGE); /* enum starts from 1 */
        test_table(dhcp_use_domains, DHCP_USE_DOMAINS);
        test_table(duplex, DUP);
        test_table(ip6tnl_mode, NETDEV_IP6_TNL_MODE);
        test_table(ipv6_privacy_extensions, IPV6_PRIVACY_EXTENSIONS);
        test_table(ipvlan_flags, NETDEV_IPVLAN_FLAGS);
        test_table(link_operstate, LINK_OPERSTATE);
        /* test_table(link_state, LINK_STATE);  — not a reversible mapping */
        test_table(lldp_mode, LLDP_MODE);
        test_table(netdev_kind, NETDEV_KIND);
        test_table(nl_union_link_info_data, NL_UNION_LINK_INFO_DATA);
        test_table(wol, WOL);

        test_table_sparse(dhcp6_message_type, DHCP6_MESSAGE);
        test_table_sparse(ipvlan_mode, NETDEV_IPVLAN_MODE);
        test_table_sparse(macvlan_mode, NETDEV_MACVLAN_MODE);

        return EXIT_SUCCESS;
}
コード例 #2
0
int main(int argc, char **argv) {
    test_table(bond_mode, NETDEV_BOND_MODE);
    /* test_table(link_state, LINK_STATE);  — not a reversible mapping */
    test_table(link_operstate, LINK_OPERSTATE);
    test_table(address_family_boolean, ADDRESS_FAMILY_BOOLEAN);
    test_table(netdev_kind, NETDEV_KIND);
    test_table(dhcp6_message_status, DHCP6_STATUS);
    test_table(duplex, DUP);
    test_table(wol, WOL);
    test_table(nl_union_link_info_data, NL_UNION_LINK_INFO_DATA);

    test_table_sparse(macvlan_mode, NETDEV_MACVLAN_MODE);
    test_table_sparse(ipvlan_mode, NETDEV_IPVLAN_MODE);
    test_table_sparse(dhcp6_message_type, DHCP6_MESSAGE);

    return EXIT_SUCCESS;
}
コード例 #3
0
int main(int argc, char **argv) {
        uint16_t i;

        test_table_sparse(dns_type, DNS_TYPE);

        log_info("/* DNS_TYPE */");
        for (i = 0; i < _DNS_TYPE_MAX; i++) {
                const char *s;

                s = dns_type_to_string(i);
                assert_se(s == NULL || strlen(s) < _DNS_TYPE_STRING_MAX);

                if (s)
                        log_info("%-*s %s%s%s%s%s%s%s%s%s",
                                 (int) _DNS_TYPE_STRING_MAX - 1, s,
                                 dns_type_is_pseudo(i) ? "pseudo " : "",
                                 dns_type_is_valid_query(i) ? "valid_query " : "",
                                 dns_type_is_valid_rr(i) ? "is_valid_rr " : "",
                                 dns_type_may_redirect(i) ? "may_redirect " : "",
                                 dns_type_is_dnssec(i) ? "dnssec " : "",
                                 dns_type_is_obsolete(i) ? "obsolete " : "",
                                 dns_type_may_wildcard(i) ? "wildcard " : "",
                                 dns_type_apex_only(i) ? "apex_only " : "",
                                 dns_type_needs_authentication(i) ? "needs_authentication" : "");
        }

        log_info("/* DNS_CLASS */");
        for (i = 0; i < _DNS_CLASS_MAX; i++) {
                const char *s;

                s = dns_class_to_string(i);
                assert_se(s == NULL || strlen(s) < _DNS_CLASS_STRING_MAX);

                if (s)
                        log_info("%-*s %s%s",
                                 (int) _DNS_CLASS_STRING_MAX - 1, s,
                                 dns_class_is_pseudo(i) ? "is_pseudo " : "",
                                 dns_class_is_valid_rr(i) ? "is_valid_rr " : "");
        }

        return EXIT_SUCCESS;
}
コード例 #4
0
ファイル: test-tables.c プロジェクト: michich/systemd
int main(int argc, char **argv) {
        test_table(architecture, ARCHITECTURE);
        test_table(automount_result, AUTOMOUNT_RESULT);
        test_table(automount_state, AUTOMOUNT_STATE);
        test_table(bus_policy_access, BUS_POLICY_ACCESS);
        test_table(busname_result, BUSNAME_RESULT);
        test_table(busname_state, BUSNAME_STATE);
        test_table(cgroup_device_policy, CGROUP_DEVICE_POLICY);
        test_table(condition_type, CONDITION_TYPE);
        test_table(assert_type, CONDITION_TYPE);
        test_table(condition_result, CONDITION_RESULT);
        test_table(device_state, DEVICE_STATE);
        test_table(exec_input, EXEC_INPUT);
        test_table(exec_output, EXEC_OUTPUT);
        test_table(failure_action, FAILURE_ACTION);
        test_table(job_mode, JOB_MODE);
        test_table(job_result, JOB_RESULT);
        test_table(job_state, JOB_STATE);
        test_table(job_type, JOB_TYPE);
        test_table(kill_mode, KILL_MODE);
        test_table(kill_who, KILL_WHO);
        test_table(log_target, LOG_TARGET);
        test_table(mac_policy, MACPOLICY);
        test_table(manager_state, MANAGER_STATE);
        test_table(mount_exec_command, MOUNT_EXEC_COMMAND);
        test_table(mount_result, MOUNT_RESULT);
        test_table(mount_state, MOUNT_STATE);
        test_table(name_policy, NAMEPOLICY);
        test_table(notify_access, NOTIFY_ACCESS);
        test_table(output_mode, OUTPUT_MODE);
        test_table(path_result, PATH_RESULT);
        test_table(path_state, PATH_STATE);
        test_table(path_type, PATH_TYPE);
        test_table(policy_item_class, POLICY_ITEM_CLASS);
        test_table(policy_item_type, POLICY_ITEM_TYPE);
        test_table(protect_home, PROTECT_HOME);
        test_table(protect_system, PROTECT_SYSTEM);
        test_table(rlimit, RLIMIT);
        test_table(scope_result, SCOPE_RESULT);
        test_table(scope_state, SCOPE_STATE);
        test_table(service_exec_command, SERVICE_EXEC_COMMAND);
        test_table(service_restart, SERVICE_RESTART);
        test_table(service_result, SERVICE_RESULT);
        test_table(service_state, SERVICE_STATE);
        test_table(service_type, SERVICE_TYPE);
        test_table(slice_state, SLICE_STATE);
        test_table(snapshot_state, SNAPSHOT_STATE);
        test_table(socket_address_bind_ipv6_only, SOCKET_ADDRESS_BIND_IPV6_ONLY);
        test_table(socket_exec_command, SOCKET_EXEC_COMMAND);
        test_table(socket_result, SOCKET_RESULT);
        test_table(socket_state, SOCKET_STATE);
        test_table(split_mode, SPLIT);
        test_table(storage, STORAGE);
        test_table(swap_exec_command, SWAP_EXEC_COMMAND);
        test_table(swap_result, SWAP_RESULT);
        test_table(swap_state, SWAP_STATE);
        test_table(target_state, TARGET_STATE);
        test_table(timer_base, TIMER_BASE);
        test_table(timer_result, TIMER_RESULT);
        test_table(timer_state, TIMER_STATE);
        test_table(unit_active_state, UNIT_ACTIVE_STATE);
        test_table(unit_dependency, UNIT_DEPENDENCY);
        test_table(unit_file_change_type, UNIT_FILE_CHANGE_TYPE);
        test_table(unit_file_preset_mode, UNIT_FILE_PRESET);
        test_table(unit_file_state, UNIT_FILE_STATE);
        test_table(unit_load_state, UNIT_LOAD_STATE);
        test_table(unit_type, UNIT_TYPE);
        test_table(locale_variable, VARIABLE_LC);

        test_table_sparse(object_compressed, OBJECT_COMPRESSED);

        return EXIT_SUCCESS;
}