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,
214 args = "prog load %s %s" % (os.path.join(bpf_test_dir, sample), file_name)
229 args = "-force " + args
230 return tool("ip", args, {"json":"-j"}, JSON=JSON, ns=ns,
234 return tool("tc", args, {"json":"-p"}, JSON=JSON, ns=ns,
240 def bpf_obj(name, sec=".text", path=bpf_test_dir,): argument
241 return "obj %s sec %s" % (os.path.join(path, name), sec)
283 def __init__(self, path): argument
284 self.path = path
285 self._dict = self._debugfs_dir_read(path)
299 cmd("echo '%s' > %s/%s" % (value, self.path, key))
302 _, out = cmd('cat %s/%s' % (self.path, key))
305 def _debugfs_dir_read(self, path): argument
308 log("DebugFS state for %s" % (path), "")
311 _, out = cmd('ls ' + path)
316 p = os.path.join(path, f)
320 if os.path.isfile(p):
321 _, out = cmd('cat %s/%s' % (path, f))
323 elif os.path.isdir(p):
393 path = os.path.join(self.dfs_dir, "bpf_bound_progs")
394 _, progs = cmd('ls %s' % (path))
398 progs = DebugfsDir(os.path.join(self.dfs_dir, "bpf_bound_progs"))
446 path = os.path.join(self.dfs_dir, f)
447 _, data = cmd('cat %s' % (path))
509 args = "-s filter show dev %s ingress" % (self['ifname'])
572 args = "hw-tc-offload %s" % ("on" if enable else "off")
573 return ethtool(self, "-K", args, fail=fail)
582 cmd("rm -f %s" % (f))
608 fail(err["error"].find("No such device") == -1,
615 fail(err["error"].find("No such device") == -1,
683 start_test("Test multi-attachment XDP - %s + offload..." %
703 start_test("Test multi-attachment XDP - replace...")
705 fail(ret == 0, "Replaced one of programs without -force")
710 start_test("Test multi-attachment XDP - detach...")
729 start_test("Test multi-attachment XDP - reattach...")
737 start_test("Test multi-attachment XDP - device remove...")
747 parser.add_argument("--log", help="output verbose log to given file")
751 logfile.write("# -*-Org-*-")
771 if out.find("/sys/kernel/debug type debugfs") == -1:
772 cmd("mount -t debugfs none /sys/kernel/debug")
784 if err.find("Error: Failed to find qdisc with specified handle.") == -1:
810 start_test("Test TC non-offloaded...")
814 start_test("Test TC non-offloaded isn't getting bound...")
860 start_test("Test non-0 chain offload...")
923 start_test("Test TC offload is device-bound...")
972 fail(ret == 0, "Replaced XDP program without -force")
977 fail(ret != 0, "Could not replace XDP program with -force")
984 "Device parameters reported for non-offloaded program")
1017 start_test("Test non-offload XDP attaching to HW...")
1022 fail(ret == 0, "attached non-offloaded XDP program to HW")
1023 check_extack_nsim(err, "xdpoffload of non-bound program.", args)
1032 check_extack(err, "using device-bound program without HW_MODE flag is not supported.", args)
1078 check_extack_nsim(err, "xdpoffload of non-bound program.", args)
1142 time_diff = end - start
1215 fail(ret == 0, "updated non-existing key")
1216 fail(err["error"].find("No such file or directory") == -1,
1226 fail(err["error"].find("File exists") == -1,
1250 fail(err["error"].find("No such file or directory") == -1,
1262 fail(err["error"].find("No such file or directory") == -1,
1276 start_test("Test map creation fail path...")
1286 start_test("Test multi-dev ASIC program reuse...")
1305 start_test("Test multi-dev ASIC cross-dev replace...")
1307 fail(ret == 0, "cross-ASIC program allowed")
1310 fail(ret == 0, "cross-ASIC program allowed")
1312 start_test("Test multi-dev ASIC cross-dev install...")
1318 fail(ret == 0, "cross-ASIC program allowed")
1323 fail(ret == 0, "cross-ASIC program allowed")
1326 start_test("Test multi-dev ASIC cross-dev map reuse...")
1344 "error message missing for cross-ASIC map")
1352 "error message missing for cross-ASIC map")
1354 start_test("Test multi-dev ASIC cross-dev destruction...")
1365 start_test("Test multi-dev ASIC cross-dev destruction - move...")
1378 start_test("Test multi-dev ASIC cross-dev destruction - orphaned...")
1385 print("%s: OK" % (os.path.basename(__file__)))