Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecXVQ-0004eu-IH for pgsql-bugs@arkaria.postgresql.org; Fri, 19 Jan 2018 14:18:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecXVP-0003tL-RU for pgsql-bugs@arkaria.postgresql.org; Fri, 19 Jan 2018 14:18:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ecXVP-0003tC-KH for pgsql-bugs@lists.postgresql.org; Fri, 19 Jan 2018 14:18:55 +0000 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ecXVH-0003hf-Ht for pgsql-bugs@lists.postgresql.org; Fri, 19 Jan 2018 14:18:54 +0000 Received: by mail-lf0-x230.google.com with SMTP id a204so2298231lfa.2 for ; Fri, 19 Jan 2018 06:18:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=z4e+2WuCSQJY4MNdA+3QaOeCsQTYR/BU8AMB2L67wGM=; b=ckXL7AOMaUJG10tWFe0cRc/I546TA8Ku758l4Jhl4twtiQz4VltFFH95sMvNaAGXgH qj0LfvHdk/LyimZWSudhkZHPBKZAdBYCkAsi6Mf3ulIQmKunO9NH7L6pDX7oDQQpK39i 1reAjq6/JV7UYkwTbxZZl801OpTa+4p5HZJ5drPToKgmVTjF8moyTp+w2zBgAuMlTRDZ ODQsbKEqAekDGNqta+s5iLZPB6YF5RiQJcR/mHNCHmU6PQQFon6M1bJPWfK+jSLnkr4Y dxXzUidByBXhWJXDHgjG+jw9HiDZOT/A78QqsBq1FxKux8lzsQ+UuwcKIIjjj04nIdEb 7/1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=z4e+2WuCSQJY4MNdA+3QaOeCsQTYR/BU8AMB2L67wGM=; b=Tk4g9uQ0iP/rnE/X07gxq/Ur2/SGp+aaMoBg/IvC3Z/1YD/BxegQ2GHOans0t5nGoM eJXXMq4JzKypIP++ENDnc0pnb8XtdJrQKDtuajaTtTD6FVP/uYmhZLe0i/3nTQs2abvB QzEkt8le9/a673tnjSYGZp8xUPvCFV6WOzkgZTNjImA/ip8rw7YCzcmJmCOsTuJO2W0f jlaHFGxYC3C84y10WkWrcrrZAaWH+L8zLvPbldEGLwzlCQk8wev9C1KzoEvOxbv0mHL5 e/6KLbbVB+bUTVZWCDt+l+k+gyDKSSMKQFr6wWB8vRqSfEGJKHAuiZaSpVLi84Yg/hue 2X3A== X-Gm-Message-State: AKwxytfatHH3SFciI2nchRKb4XkrCLwvMf9XkcLP4F3rtvc3yxISSufr aIxfNWqzpTva/5lwXIp26/DOgzlb X-Google-Smtp-Source: ACJfBouaBNJNqbl4Vv1Y3lOwTJCphMypqJ/kzEiMLSo/joUFccVnD0QK5jycMRn2BO/8Ht7xXq5zug== X-Received: by 10.46.108.5 with SMTP id h5mr14719104ljc.48.1516371525283; Fri, 19 Jan 2018 06:18:45 -0800 (PST) Received: from seb (koffice.avito.ru. [195.151.206.25]) by smtp.gmail.com with ESMTPSA id o188sm1647844lff.5.2018.01.19.06.18.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 06:18:43 -0800 (PST) From: Sergey Burladyan To: Tomas Vondra Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15006: "make check" error if current user is "user" References: <20180111125319.1423.23692@wrigleys.postgresql.org> Date: Fri, 19 Jan 2018 17:18:43 +0300 In-Reply-To: (Tomas Vondra's message of "Wed, 17 Jan 2018 22:58:51 +0100") Message-ID: <87fu7253uk.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=-=-= Content-Type: text/plain Tomas Vondra writes: > Of course, a particularly strange distribution could still pick a > conflicting OS name, but that seems rather unlikely, I guess. Why the tests depend and use current OS user name? I think it's not very good (if you does not test exactly that, of course). If you enforce user name for temporary initdb cluster and use this name for connection in tests, then you does not depends on OS name at all, something like this (see attachment). With this patch "make check-world" run successfully with OS name "user" and "current_user". -- Sergey Burladyan --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=force-postgres.patch diff -urN old/postgresql-10.1/src/bin/pg_upgrade/test.sh new/postgresql-10.1/src/bin/pg_upgrade/test.sh --- old/postgresql-10.1/src/bin/pg_upgrade/test.sh 2017-11-07 00:46:52.000000000 +0000 +++ new/postgresql-10.1/src/bin/pg_upgrade/test.sh 2018-01-12 18:50:04.038190911 +0000 @@ -20,7 +20,7 @@ # Run a given "initdb" binary and overlay the regression testing # authentication configuration. standard_initdb() { - "$1" -N + "$1" -U postgres -N if [ -n "$TEMP_CONFIG" -a -r "$TEMP_CONFIG" ] then cat "$TEMP_CONFIG" >> "$PGDATA/postgresql.conf" @@ -153,6 +153,9 @@ # enable echo so the user can see what is being executed set -x +PGUSER=postgres +export PGUSER + standard_initdb "$oldbindir"/initdb "$oldbindir"/pg_ctl start -l "$logdir/postmaster1.log" -o "$POSTMASTER_OPTS" -w @@ -252,6 +255,8 @@ *) sh ./delete_old_cluster.sh ;; esac +unset PGUSER + if diff "$temp_root"/dump1.sql "$temp_root"/dump2.sql >/dev/null; then echo PASSED exit 0 diff -urN old/postgresql-10.1/src/test/regress/pg_regress.c new/postgresql-10.1/src/test/regress/pg_regress.c --- old/postgresql-10.1/src/test/regress/pg_regress.c 2017-11-07 00:46:52.000000000 +0000 +++ new/postgresql-10.1/src/test/regress/pg_regress.c 2018-01-12 18:03:56.732603484 +0000 @@ -829,6 +829,9 @@ sprintf(s, "%d", port); doputenv("PGPORT", s); } + + /* use user "postgres" for temp instance */ + doputenv("PGUSER", "postgres"); } else { @@ -2246,7 +2249,7 @@ /* initdb */ header(_("initializing database system")); snprintf(buf, sizeof(buf), - "\"%s%sinitdb\" -D \"%s/data\" --no-clean --no-sync%s%s > \"%s/log/initdb.log\" 2>&1", + "\"%s%sinitdb\" -D \"%s/data\" -U postgres --no-clean --no-sync%s%s > \"%s/log/initdb.log\" 2>&1", bindir ? bindir : "", bindir ? "/" : "", temp_instance, @@ -2317,7 +2320,7 @@ * Check if there is a postmaster running already. */ snprintf(buf2, sizeof(buf2), - "\"%s%spsql\" -X postgres <%s 2>%s", + "\"%s%spsql\" -X -U postgres <%s 2>%s", bindir ? bindir : "", bindir ? "/" : "", DEVNULL, DEVNULL); --=-=-=--