Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964945AbbGHK0W (ORCPT ); Wed, 8 Jul 2015 06:26:22 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:42517 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933891AbbGHKZl (ORCPT ); Wed, 8 Jul 2015 06:25:41 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-f8-559cfaa1ba04 From: Paul Osmialowski To: Paul Moore , James Morris , Casey Schaufler , "Serge E. Hallyn" , Kees Cook , Tetsuo Handa , Stephen Smalley , Neil Brown , Mark Rustad , Greg Kroah-Hartman , Daniel Mack , David Herrmann , Djalal Harouni , Shuah Khan , Al Viro , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: Karol Lewandowski , Paul Osmialowski , Lukasz Skalski Subject: [RFC 8/8] kdbus: Ability to run kdbus test by executable binary name Date: Wed, 08 Jul 2015 12:25:10 +0200 Message-id: <1436351110-5902-9-git-send-email-p.osmialowsk@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1436351110-5902-1-git-send-email-p.osmialowsk@samsung.com> References: <1436351110-5902-1-git-send-email-p.osmialowsk@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmkeLIzCtJLcpLzFFi42I5/e/4Vd2Fv+aEGqy6bGJxb9svNoumv69Y LBZfFrNoXryezaLvcZBF46e5zBZnunMt5pxrZLLY/L2DzeLyrjlsFh96HrFZzHn7ls1i7/wG FosJbw4wW8xuecdq8fnaL3aLw7sXM1ucv3CO3WLqlw8sFit/b2ezOP/3OKuDqMfshossHk8n TGb3uLY70mPn2lVMHov3vGTy2D93DbvHil9H2D0+Pr3F4rGl/y67x/t9V9k8+rasYvQ4un8R m8fm09UeW6f/Z/X4vEnOY9OTt0wBglFcNimpOZllqUX6dglcGdOeXmUu+MtR8Wv+L8YGxkXs XYycHBICJhI7J7xhhLDFJC7cW88GYgsJLGWUuHHau4uRC8huZJJ41fYNLMEmYChx8/9hsAYR gV2sEm92xIEUMQt0MkrM6TrH1MXIwSEs4Ctx/GUWSA2LgKrEreNbwJbxCrhLPN3xgAlimZzE yWOTWUFsTgEPiYUvvzJDLHaX2Lj6H9sERt4FjAyrGEVTS5MLipPScw31ihNzi0vz0vWS83M3 MUKi6MsOxsXHrA4xCnAwKvHwesTMCRViTSwrrsw9xCjBwawkwrvrAlCINyWxsiq1KD++qDQn tfgQozQHi5I479xd70OEBNITS1KzU1MLUotgskwcnFINjA6LI7p3vPpVwCzz57r2fLbp3j5H FcSr0h7qS8amfdxUrnddvshwhUVLf+jtqa2a+wPmst+Onrf9ONemuLsuS9eWtvC/eP9vmqKp +oEtBX3X4qfuXlhgUN/5TPOiNjfndnXdMHWNE3LlR8Td9kzprz4hNSOH42Ov7XOuPW7Ff7mv +792yzpsocRSnJFoqMVcVJwIAChFiM+eAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1348 Lines: 51 With this applied, you can do following: $ cp kdbus-test daemon $ cp kdbus-test send Then run 'daemon' in one shell session: $ ./daemon --bus test ...and 'send' in another: $ ./send --bus test Useful for testing features introduced by previous patches. Signed-off-by: Paul Osmialowski --- tools/testing/selftests/kdbus/kdbus-test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/kdbus/kdbus-test.c b/tools/testing/selftests/kdbus/kdbus-test.c index 5a296da..9efbc5f 100644 --- a/tools/testing/selftests/kdbus/kdbus-test.c +++ b/tools/testing/selftests/kdbus/kdbus-test.c @@ -829,6 +829,7 @@ int main(int argc, char *argv[]) ARG_UIDMAP, ARG_GIDMAP, }; + char *exec = basename(argv[0]); kdbus_args = malloc(sizeof(*kdbus_args)); if (!kdbus_args) { @@ -858,6 +859,10 @@ int main(int argc, char *argv[]) srand(time(NULL)); + if (strcmp(exec, "kdbus-test") != 0) { + kdbus_args->test = exec; + } + while ((t = getopt_long(argc, argv, "hxfm:r:t:b:w:a", options, NULL)) >= 0) { switch (t) { case 'x': -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/