Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNZo9-0001ci-HN for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Mar 2021 11:30:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lNZo6-0002g0-SN for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Mar 2021 11:30:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNZo5-0002fr-ES for pgsql-hackers@lists.postgresql.org; Sat, 20 Mar 2021 11:30:14 +0000 Received: from [66.111.4.28] (helo=out4-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNZnx-00070M-HC for pgsql-hackers@lists.postgresql.org; Sat, 20 Mar 2021 11:30:13 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AF1135C00B0; Sat, 20 Mar 2021 07:29:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 20 Mar 2021 07:29:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=vyT3bu7vPLIVwnGFuwEliRX4j6k kwuyAillroqYq2vg=; b=GKdSXPinoLPUrNHVJPrnw/TNl07Gzq2W9RqIKBsFb1X flzF34d+bCI4uQ5R6QZSH6Djsx8FC+VVbkxdZMHT+GJTRk29jhEMwvECSMS7YVNa NBS19ZDIIxnnn0apWopY5uA6rMBl4cFmJKiMPmh2rfrLo3s0k13vWv6vlR0x5rv4 lzJs4lJVhuyr4obDRoMkJGwBuduGJVEPCEuDVwc0C/jlz3i3p5Jk5iy3Kk0IHSLN DwuiX07NltSVtwOoSVbRxt8J8tBo3sLplRQ8IebrxE2QP59Vle453WGvfdZwX0UR JB436CMxClvthhtPVt5QHmkN1UbW0Sv2M1Jnv8bNcFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=vyT3bu 7vPLIVwnGFuwEliRX4j6kkwuyAillroqYq2vg=; b=cGVpN41LT3PiCFv3ms5hjB CP1gLxgAUf+Z1sHDT7NWKCKZjydghYV+K3rdeOHYkPyyt25GJqH7Rwxb3NhOY/mk IQGt3yF6r/htPXb3ld3NLzcAm+pZFhcfIdPwbHDCsWXrRbUp9d6/6uUJMqzMvRXb Pndd+mhNIH6MqmXCnqv8pfm/4nEUe1y8fyOOENwE4enHwN+LQHRIKKD+4zAZxnqe 4IcwGA8bYeHnwhTIe/fEGWRYWCIJy+DofHPvwoTIfepCTau6p6I/ZYatoHpuO/bW BHSh1xnp/wkq8iHYqqkFj/GK5BT//EpOYQCvVm4eaN2bvnu2bhMACI7ZkjLCuXag == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegtddgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucfkphepudduuddruddtvddrudektd drudekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 873CF240119; Sat, 20 Mar 2021 07:29:51 -0400 (EDT) Date: Sat, 20 Mar 2021 20:29:47 +0900 From: Michael Paquier To: Stephen Frost Cc: vignesh C , Bharath Rupireddy , Euler Taveira , PostgreSQL Hackers Subject: Re: Log message for GSS connection is missing once connection authorization is successful. Message-ID: References: <20201127220136.GQ16415@tamriel.snowman.net> <20201202194430.GZ16415@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="upChRnvqrY4Pl6Bq" Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.28 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --upChRnvqrY4Pl6Bq Content-Type: multipart/mixed; boundary="LZClPchuqifeLZtf" Content-Disposition: inline --LZClPchuqifeLZtf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Mar 20, 2021 at 05:37:47PM +0900, Michael Paquier wrote: > It seems to me that this would make the tests faster, that the test > would not need to wait for the logging collector and that the code > could just use slurp_file($node->logfile) to get the data it wants to > check for a given pattern without looking at current_logfiles. I also > think that not using truncate() on the logfile generated has the > disadvantage to make the code fuzzy for its verification once we > introduce patterns close to each other, as there could easily be an > overlap. That's one problem that SQL pattern checks had to deal with > in the past. Thoughts? And, in terms of code, this really simplifies things. Please see the attached that I would like to apply. -- Michael --LZClPchuqifeLZtf Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="krb5-test-simplify.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth= =2Epl index 079321bbfc..38e9ef7b1f 100644 --- a/src/test/kerberos/t/001_auth.pl +++ b/src/test/kerberos/t/001_auth.pl @@ -20,7 +20,7 @@ use Time::HiRes qw(usleep); =20 if ($ENV{with_gssapi} eq 'yes') { - plan tests =3D> 34; + plan tests =3D> 26; } else { @@ -170,10 +170,7 @@ $node->append_conf( 'postgresql.conf', qq{ listen_addresses =3D '$hostaddr' krb_server_keyfile =3D '$keytab' -logging_collector =3D on log_connections =3D on -# these ensure stability of test results: -log_rotation_age =3D 0 lc_messages =3D 'C' }); $node->start; @@ -212,29 +209,15 @@ sub test_access # Verify specified log message is logged in the log file. if ($expect_log_msg ne '') { - my $current_logfiles =3D slurp_file($node->data_dir . '/current_logfiles= '); - note "current_logfiles =3D $current_logfiles"; - like($current_logfiles, qr|^stderr log/postgresql-.*log$|, - 'current_logfiles is sane'); - - my $lfname =3D $current_logfiles; - $lfname =3D~ s/^stderr //; - chomp $lfname; - - # might need to retry if logging collector process is slow... - my $max_attempts =3D 180 * 10; - my $first_logfile; - for (my $attempts =3D 0; $attempts < $max_attempts; $attempts++) - { - $first_logfile =3D slurp_file($node->data_dir . '/' . $lfname); - last if $first_logfile =3D~ m/\Q$expect_log_msg\E/; - usleep(100_000); - } + my $first_logfile =3D slurp_file($node->logfile); =20 like($first_logfile, qr/\Q$expect_log_msg\E/, 'found expected log file content'); } =20 + # Clean up any existing contents in the node's log file so as + # future tests don't step on each other's generated contents. + truncate $node->logfile, 0; return; } =20 --LZClPchuqifeLZtf-- --upChRnvqrY4Pl6Bq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmBV3KsACgkQnvQgOdby QH2vrg/9Ei+vJggj52hYAAqPVuyI8NVe+fZyqz0w7qNDyhFaCjthxvVVeKMnkb/O oNcH8Obw4kTFtAxAeaJxnTwYZtfRPCV5XoYQyhEFT0W4vrppqbHJ4W6F9iHHeLlW 1H+ps6ztMdFitxkgJe+qQihmMmlSRKeNRvLt1TAwroxRljym/sg95Wo0Fb4n5PHo K4sQ9yOZXLdEw2yPg/k9M5I5xSrrNW3HBLzpQ0DgsI8Crt0QCcWQT8GrpXwO+TH0 /YAayVHjNFzY47yYddb+AkUp45lN1w/43lelkN8VgoPuLBu2Ct9y4uyKAFD9pi0z 3qAQuUDHTJkbGupri4vzUGS1rc3fOW19C/nDSInO1LROCPDlgAPEReqB3CyDOiaC TNDCMPyhf2vboGhNSYGYZC5qy8rFTq2/010IHP0t6eMJr+7hWfImPGva/NqTP3gx SVPBSUuSYtB5eL38ttUnVUr1WBN3UePjX8XkAFdUWHdZ0xJVZuvcDOuyctGGX0bF wbSGfqdYCjcI1gzwORugKLa7ViOsgo2FEGjhBVOB5Q6yHCkU8VS7gyFlZWtVLuEq 1R8NQxg5VeiKWnqaYsfsemnNtPEAuZBXdcIvsGoqoxca6vrHBSPx2sXksVsxGQ+4 gS0Sx3EIviHHUyU3vLmr+c7TQAvtOiNSmmEuVxbJ6RuZmAk1QwA= =7GAz -----END PGP SIGNATURE----- --upChRnvqrY4Pl6Bq--