Lines Matching +full:stdout +full:- +full:path

7 # June 1991 as shown in the file COPYING in the top-level directory of this
35 bpf_test_dir = os.path.dirname(os.path.realpath(__file__))
50 log_level -= sub
98 Run a command in subprocess and return tuple of (retval, stdout);
101 proc = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE,
112 stdout, stderr = proc.communicate()
113 stdout = stdout.decode("utf-8")
114 stderr = stderr.decode("utf-8")
115 proc.stdout.close()
119 if stderr[-1] == "\n":
120 stderr = stderr[:-1]
124 "RETCODE: %d\n%s STDOUT:\n%s%s STDERR:%s\n%s END: %s" %
125 (proc.returncode, sec, stdout, sec, stderr,
129 if len(stderr) > 0 and stderr[-1] == "\n":
130 stderr = stderr[:-1]
134 return proc.returncode, stdout, stderr
136 return proc.returncode, stdout
139 cmd("rm -f %s" % (f))
152 ret, stdout, stderr = cmd(ns + name + " " + params + args,
155 ret, stdout = cmd(ns + name + " " + params + args,
158 if JSON and len(stdout.strip()) != 0:
159 out = json.loads(stdout)
161 out = stdout
169 return tool("bpftool", args, {"json":"-p"}, JSON=JSON, ns=ns,
212 args = "prog load %s %s" % (os.path.join(bpf_test_dir, sample), file_name)
227 args = "-force " + args
228 return tool("ip", args, {"json":"-j"}, JSON=JSON, ns=ns,
232 return tool("tc", args, {"json":"-p"}, JSON=JSON, ns=ns,
238 def bpf_obj(name, sec=".text", path=bpf_test_dir,): argument
239 return "obj %s sec %s" % (os.path.join(path, name), sec)
281 def __init__(self, path): argument
282 self.path = path
283 self._dict = self._debugfs_dir_read(path)
297 cmd("echo '%s' > %s/%s" % (value, self.path, key))
300 _, out = cmd('cat %s/%s' % (self.path, key))
303 def _debugfs_dir_read(self, path): argument
306 log("DebugFS state for %s" % (path), "")
309 _, out = cmd('ls ' + path)
314 p = os.path.join(path, f)
318 if os.path.isfile(p):
321 cmd('echo deadbeef > %s/%s' % (path, f))
322 _, out = cmd('cat %s/%s' % (path, f))
324 elif os.path.isdir(p):
340 def ctrl_write(path, val): argument
341 fullpath = os.path.join("/sys/bus/netdevsim/", path)
346 log("WRITE %s: %r" % (fullpath, val), -e.errno)
403 path = os.path.join(self.dfs_dir, "bpf_bound_progs")
404 _, progs = cmd('ls %s' % (path))
408 progs = DebugfsDir(os.path.join(self.dfs_dir, "bpf_bound_progs"))
455 path = os.path.join(self.dfs_dir, f)
456 _, data = cmd('cat %s' % (path))
518 args = "-s filter show dev %s ingress" % (self['ifname'])
581 args = "hw-tc-offload %s" % ("on" if enable else "off")
582 return ethtool(self, "-K", args, fail=fail)
591 cmd("rm -f %s" % (f))
617 fail(err["error"].find("No such device") == -1,
624 fail(err["error"].find("No such device") == -1,
692 start_test("Test multi-attachment XDP - %s + offload..." %
712 start_test("Test multi-attachment XDP - replace...")
714 fail(ret == 0, "Replaced one of programs without -force")
717 start_test("Test multi-attachment XDP - remove without mode...")
736 start_test("Test multi-attachment XDP - reattach...")
744 start_test("Test multi-attachment XDP - device remove...")
754 parser.add_argument("--log", help="output verbose log to given file")
758 logfile.write("# -*-Org-*-")
781 if out.find("/sys/kernel/debug type debugfs") == -1:
782 cmd("mount -t debugfs none /sys/kernel/debug")
794 if err.find("Error: Failed to find qdisc with specified handle.") == -1:
820 start_test("Test TC non-offloaded...")
824 start_test("Test TC non-offloaded isn't getting bound...")
870 start_test("Test non-0 chain offload...")
940 start_test("Test TC offload is device-bound...")
990 fail(ret == 0, "Replaced XDP program without -force")
995 fail(ret != 0, "Could not replace XDP program with -force")
1002 "Device parameters reported for non-offloaded program")
1025 start_test("Test non-offload XDP attaching to HW...")
1030 fail(ret == 0, "attached non-offloaded XDP program to HW")
1031 check_extack_nsim(err, "xdpoffload of non-bound program.", args)
1040 check_extack(err, "Using device-bound program without HW_MODE flag is not supported.", args)
1094 check_extack_nsim(err, "xdpoffload of non-bound program.", args)
1158 time_diff = end - start
1231 fail(ret == 0, "updated non-existing key")
1232 fail(err["error"].find("No such file or directory") == -1,
1242 fail(err["error"].find("File exists") == -1,
1266 fail(err["error"].find("No such file or directory") == -1,
1278 fail(err["error"].find("No such file or directory") == -1,
1292 start_test("Test map creation fail path...")
1302 start_test("Test multi-dev ASIC program reuse...")
1321 start_test("Test multi-dev ASIC cross-dev replace...")
1323 fail(ret == 0, "cross-ASIC program allowed")
1326 fail(ret == 0, "cross-ASIC program allowed")
1328 start_test("Test multi-dev ASIC cross-dev install...")
1334 fail(ret == 0, "cross-ASIC program allowed")
1339 fail(ret == 0, "cross-ASIC program allowed")
1342 start_test("Test multi-dev ASIC cross-dev map reuse...")
1360 "error message missing for cross-ASIC map")
1368 "error message missing for cross-ASIC map")
1370 start_test("Test multi-dev ASIC cross-dev destruction...")
1381 start_test("Test multi-dev ASIC cross-dev destruction - move...")
1394 start_test("Test multi-dev ASIC cross-dev destruction - orphaned...")
1401 print("%s: OK" % (os.path.basename(__file__)))