Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp178180ybx; Wed, 30 Oct 2019 13:15:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMTOT3H75URKnMFrl4Um4MqHRZR4l4bQdQb4kYipc/Y2TZgCzrDfuu+1j14E36eHnaXt27 X-Received: by 2002:a17:906:29ce:: with SMTP id y14mr36138eje.271.1572466500167; Wed, 30 Oct 2019 13:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572466500; cv=none; d=google.com; s=arc-20160816; b=y9OjfRUtV6ooYQXML01PVMuzHIgFulxxWrm3PjKzvvcBODWgtF3N1hFfi86V8V1eLA Rvf1Tn3J+HsfjjWNA7ys3r9qsB8OvurULlnMMjdD6JAAS8ORnue3dQorx8O5kzEflbnq PsHWkugFecNjXPvlx02IW8OaVVcoLd7YV4xIpYTq/8uuJ0w9XS5LiU6SnPCPnyFRqU/j CJNTmynxKpgScpXGONOfSJrgS2XJrRqBYW+7a8VnlHAzy1rMHdap3aOmeER8/OF4EI0f ocqhVWU2LSDjdf/bwcARHcmcx1t0QoCrZOIKK/lbOfdzaMLr4qrmvVwbDayzZ2JvGzei o7KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/GCjoby9r+s+PmV1FeOt/O5VIxJ79kYZdBdHtT5yosc=; b=qLdEz3NFum7jw9n/yPGLOvY5zXiPyIrs8v293o6bSpe1H/p0blcSUur0AnniAlEK85 OwXWg2E94T18XwGP1j3KY11iwgMcw6phlwyEB7oa3Cpp70jYlkE5Vbo1Z2Rxao5askgH yNFrRQD/gASjmsTrlGF3dhzmUe7cjKShSCHr5hXEYOA7BFhNOKb6wM8tdYh4oG09wKLq ckYMeQBmsS713Xt75Aqh2x9E5FaHXNuebWA7gpOVBTNMOx7yJUkdHgKe5U9qRR/wziLR KNdtUyJjkgNVPU3DmW+ktYLo8E1JXxTXmgx/S4ShrUQRt7fRixleL0dmhtyv44Fo838v hvrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hs4u13vD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gh2si1916395ejb.330.2019.10.30.13.14.36; Wed, 30 Oct 2019 13:15:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hs4u13vD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726760AbfJ3UMW (ORCPT + 99 others); Wed, 30 Oct 2019 16:12:22 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:33560 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726695AbfJ3UMV (ORCPT ); Wed, 30 Oct 2019 16:12:21 -0400 Received: by mail-qk1-f194.google.com with SMTP id 71so4228377qkl.0 for ; Wed, 30 Oct 2019 13:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/GCjoby9r+s+PmV1FeOt/O5VIxJ79kYZdBdHtT5yosc=; b=hs4u13vDJKlNQDZKcbNVyPbIOUO4++rTthQnsQzTyBa9XWD0PqFcDlID67q4NaHOBr IHr6T6nX966JNzI2EeAQe8lLYg4I7H/NQsjt21lvxwCAt877j6p8citQow+UzZ2zrgyq oAyDlNvuSdlMkxFLCJTc07wUsNKAFK1j52tckNVnHzCvkhlpasTLzWVn++Srb25T1rcv w862U9tnBYoWP+h71e1Pj7OqujSeAW4Viig8S+wYMQUlS6wkq8M+fN9V4LmNvUXdq54P o+arqYUKSHdF3PCMnfWptbn2gLDX1+yJ/5QCCvsNT520P7REY8HVYZ8Wn6QqMtsqQtWH Ap2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/GCjoby9r+s+PmV1FeOt/O5VIxJ79kYZdBdHtT5yosc=; b=bjhDz8uEiNV3jpJhEXY5rZ4T4eMkvZdQdehkqg9zdP1CkS6CzIDAtrqGg1pDvipsI2 /qFtOm0FSn5Lwq9gC8dpa6ql5U4x0pWSw7mqq0MR0YfCMx3r6B0888tnW89Pak744+58 hZRU7mLfdHHMbQ4muGsn4UWQ5KgJu5ZtUCTC7jxp+qjns2OTIIiyusEDejjzrAYG8yl7 bRBEnW3jPUiMo8KSFDmNZChW0HXsd/1/sfGLeMeSQwclWetlP8AWiC7BFxZACCd63yqT LLk3iHn/SODv0JiU0ZP5Db9ymTzYfK5YgqN4tA9J7cYO1PC99F4QKODKBiNh2xOod2FB 39BA== X-Gm-Message-State: APjAAAVuj39GLj0byX8BzalJxLH2MODJi6wEig6Cm8JAi2tThleu3stC qwnvtuDKkSmdAjrovT0PTAUlGH+HmB4zRKWpmC4u X-Received: by 2002:a37:bb06:: with SMTP id l6mr1807038qkf.289.1572466340480; Wed, 30 Oct 2019 13:12:20 -0700 (PDT) MIME-Version: 1.0 References: <20191018001816.94460-1-brendanhiggins@google.com> <20191018122949.GD11244@42.do-not-panic.com> <20191024101529.GK11244@42.do-not-panic.com> <201910301205.74EC2A226D@keescook> In-Reply-To: <201910301205.74EC2A226D@keescook> From: Iurii Zaikin Date: Wed, 30 Oct 2019 13:11:44 -0700 Message-ID: Subject: Re: [PATCH linux-kselftest/test v1] apparmor: add AppArmor KUnit tests for policy unpack To: Kees Cook Cc: Luis Chamberlain , Brendan Higgins , Alan Maguire , Matthias Maennich , shuah , John Johansen , jmorris@namei.org, serge@hallyn.com, David Gow , "Theodore Ts'o" , Linux Kernel Mailing List , linux-security-module@vger.kernel.org, KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Mike Salvatore Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Why can't unit tests live with the code they're testing? They're already > logically tied together; what's the harm there? This needn't be the case > for ALL tests, etc. The test driver could still live externally. The > test in the other .c would just have exported functions... ? > Curiously enough, this approach has been adopted by D 2.0 where unittests are members of the class under test: https://digitalmars.com/d/2.0/unittest.html but such approach is not mainstream. I personally like the idea of testing the lowest level bits in isolation even if they are not a part of any interface. I think that specifying the interface using unit tests and ensuring implementation correctness are complementary but I haven't had much luck arguing this with our esteemed colleagues.