From 1e4ac2972ded8f6bba99300adfb77577bb14726d Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Thu, 20 Jan 2022 16:58:36 -0500 Subject: [PATCH] makekconfig.py: Exit with an error if there was a compile error Signed-off-by: Anna Schumaker --- makekconfig.py | 9 +++++++-- rping.zsh | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/makekconfig.py b/makekconfig.py index 9833b59..051cbb9 100755 --- a/makekconfig.py +++ b/makekconfig.py @@ -16,7 +16,7 @@ Args = parser.parse_args() Kconfig = pathlib.Path(Args.kconfig[0]) Config = pathlib.Path("scripts/config").absolute() Make = pathlib.Path("~/bin/makelinux.zsh").expanduser() -MakeArg = Args.makeargs + ([ f"{str(Kconfig.parent)}/" ] if Args.quick else [ ]) +MakeArg = Args.makeargs + ([ f"{str(Kconfig)}/" ] if Args.quick else [ ]) Options = dict() Colors = { "n" : "grey", "y" : "green", "m" : "cyan" } Attrs = { "y" : [ "bold" ], "m" : [ "bold" ] } @@ -80,7 +80,10 @@ class Option: termcolor.cprint(self.state, Colors.get(self.state), attrs=["bold", "dark"]) def print_result(self): - result = ("Success", "green") if self.res == True else ("Failed", "red") + match self.res: + case True: result = ("Success", "green") + case False: result = ("Failed", "red") + case _: result = ("Not Run", "yellow") termcolor.cprint(" " + self.name + " ", Colors.get(self.state), attrs=["bold", "dark"], end="") termcolor.cprint(" " * (NameLen - len(self.name)), "grey", attrs=["underline"], end="") termcolor.cprint(" " + result[0], result[1], attrs=["bold", "dark"]) @@ -97,6 +100,7 @@ def make_opt(option): option.enable() print() for o in options: o.print() + option.res = False subprocess.run([ Make ] + [ "olddefconfig" ]).check_returncode() subprocess.run([ Make ] + MakeArg).check_returncode() option.res = True @@ -110,3 +114,4 @@ except Exception as e: finally: termcolor.cprint(f"\nKconfig Results:", "yellow", attrs=["bold", "underline"]) for opt in options: opt.print_result() + if False in [ opt.res for opt in options ]: sys.exit(1) diff --git a/rping.zsh b/rping.zsh index e892ffe..8764c02 100755 --- a/rping.zsh +++ b/rping.zsh @@ -16,6 +16,7 @@ tags=($(python $BIN/colors/vm.py $CLIENT $SERVER)) $BIN/rdma.zsh $RDMA $CLIENT $SERVER ssh $SERVER "rping -s -C 1 -v 2>&1" | sed "s/^/${tags[2]} /" & +sleep 1 ssh $CLIENT "rping -c -C 1 -S 40 -v -a $SERVER 2>&1" | sed "s/^/${tags[1]} /" wait $(jobs -pr)