Lines Matching full:expected

177 def bpftool_prog_list(expected=None, ns="", exclude_orphaned=True):
185 if expected is not None:
186 if len(progs) != expected:
187 fail(True, "%d BPF programs loaded, expected %d\nLoaded Progs:\n%s" %
188 (len(progs), expected, pp.pformat(progs)))
191 def bpftool_map_list(expected=None, ns=""):
195 if expected is not None:
196 if len(maps) != expected:
197 fail(True, "%d BPF maps loaded, expected %d" %
198 (len(maps), expected))
201 def bpftool_prog_list_wait(expected=0, n_retry=20):
204 if nprogs == expected:
207 raise Exception("Time out waiting for program counts to stabilize want %d, have %d" % (expected, nprogs))
209 def bpftool_map_list_wait(expected=0, n_retry=20, ns=""):
214 if nmaps == expected:
217 raise Exception("Time out waiting for map counts to stabilize want %d, have %d" % (expected, nmaps))
362 def dfs_get_bound_progs(self, expected):
364 if expected is not None:
365 if len(progs) != expected:
366 fail(True, "%d BPF programs bound, expected %d" %
367 (len(progs), expected))
440 "XDP program not reporting in iplink (reported %s, expected %s)" %
455 def tc_show_ingress(self, expected=None):
480 if expected is not None:
481 fail(len(filters) != expected,
482 "%d ingress filters loaded, expected %d" %
483 (len(filters), expected))
540 progs = bpftool_prog_list(expected=(idx + 1))
547 def pin_map(file_name, idx=0, expected=1):
548 maps = bpftool_map_list_wait(expected=expected)
556 bpftool_prog_list(expected=0)
557 bpftool_prog_list(expected=1, exclude_orphaned=False)
561 bpftool_map_list_wait(expected=0)
565 "Showing map with removed device expected ENODEV, error is %s" %
569 progs = bpftool_prog_list(expected=1, ns=ns)
585 maps = bpftool_map_list_wait(expected=2, ns=ns)
758 bpftool_prog_list_wait(expected=0)
771 simdev.dfs_get_bound_progs(expected=0)
788 simdev.dfs_get_bound_progs(expected=0)
789 ingress = sim.tc_show_ingress(expected=1)
798 simdev.dfs_get_bound_progs(expected=0)
799 ingress = sim.tc_show_ingress(expected=1)
873 dfs = simdev.dfs_get_bound_progs(expected=1)
874 progs = bpftool_prog_list(expected=1)
875 ingress = sim.tc_show_ingress(expected=1)
898 sim.tc_show_ingress(expected=0)
910 bpftool_prog_list_wait(expected=0)
919 bpftool_prog_list_wait(expected=0)
928 progs = bpftool_prog_list(expected=1)
940 bpftool_prog_list_wait(expected=1)
942 progs = bpftool_prog_list(expected=1)
961 bpftool_prog_list_wait(expected=0)
1011 progs = bpftool_prog_list(expected=1)
1016 dfs = simdev.dfs_get_bound_progs(expected=1)
1032 bpftool_prog_list_wait(expected=0)
1050 bpftool_prog_list_wait(expected=0)
1117 fail(time_diff < delay_sec, "Removal process took %s, expected %s" %
1122 bpftool_prog_list_wait(expected=0)
1146 map_file, _ = pin_map("/sys/fs/bpf/tmp_map", idx=1, expected=2)
1154 bpftool_prog_list_wait(expected=0)
1161 maps = bpftool_map_list_wait(expected=2)
1187 "expected ENOENT, error is '%s'" % (err["error"]))
1197 "expected EEXIST, error is '%s'" % (err["error"]))
1204 fail(key != i, "expected key %d, got %d" % (key, i))
1206 fail(val != i * 3, "expected value %d, got %d" % (val, i * 3))
1212 fail(key != 0, "next key %d, expected %d" % (key, 0))
1216 fail(key != 1, "next key %d, expected %d" % (key, 1))
1221 "expected ENOENT, error is '%s'" % (err["error"]))
1233 "expected ENOENT, error is '%s'" % (err["error"]))
1237 bpftool_map_list_wait(expected=0)
1244 bpftool_map_list_wait(expected=0)
1325 bpftool_prog_list_wait(expected=2)
1328 bpftool_prog_list_wait(expected=1)
1333 bpftool_prog_list_wait(expected=1)
1346 bpftool_prog_list_wait(expected=0)