Re: [PATCH bpf-next 4/4] selftests/bpf: convert test_skb_cgroup_id_user to test_progs
From: Alexis Lothoré
Date: Thu Aug 01 2024 - 06:13:18 EST
On 8/1/24 10:49, Alan Maguire wrote:
> On 31/07/2024 11:38, Alexis Lothoré (eBPF Foundation) wrote:
[...]
>> +static int wait_local_ip(void)
>> +{
>> + char *ping_cmd = ping_command(AF_INET6);
>> + int i, err;
>> +
>> + for (i = 0; i < WAIT_AUTO_IP_MAX_ATTEMPT; i++) {
>> + err = SYS_NOFAIL("%s -c 1 -W 1 %s%%%s", ping_cmd, DST_ADDR,
>> + VETH_1);
>> + if (!err)
>> + break;
>> + }
>
>
> thinking about the risks of CI flakiness, would a small sleep between
> checks be worth doing here?
I assumed that adding -W 1 (ping timeout duration) to the command would be
enough to make sure that there is a proper wait between each attempt (so
currently, waiting at most 10s for network configuration between the 2 veths).
Don't you think it is enough to prevent issues in CI ?
>> +
[...]
>> +
>> + expected_ids[0] = get_cgroup_id("/.."); /* root cgroup */
>> + expected_ids[1] = get_cgroup_id("");
>> + expected_ids[2] = get_cgroup_id(CGROUP_PATH);
>> + expected_ids[3] = 0; /* non-existent cgroup */
>> +
>> + for (level = 0; level < NUM_CGROUP_LEVELS; level++) {
>> + err = bpf_map__lookup_elem(t->skel->maps.cgroup_ids, &level,
>> + sizeof(level), &actual_ids[level],
>> + sizeof(__u64), 0);
>
> could probably simplify this + the BPF prog using a global array of
> actual_ids[], then compare it to the expected values using
> skel->bss->actual_ids
ACK, I'll update this.
Thanks,
Alexis
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com