On Thu, Jan 7, 2021 at 10:02:14AM -0500, Bruce Momjian wrote: > My next step is to add the high-level tests.
Here is the high-level script, and the log output. I used the pg_upgrade test.sh as a model. It uses "CFE DEBUG" lines that are already in the code to compare the initdb encryption with the other initdb decryption and pg_ctl decryption. It was easier than I thought. What it does not do is to test the file descriptor passing from /dev/tty, or the sample scripts. This seems acceptable to me since I test them and they rarely change. -- Bruce Momjian <br...@momjian.us> https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee
test.sh
Description: Bourne shell script
make[1]: Leaving directory '/usr/local/src/gen/pgsql/postgresql/src/common' MAKE= PATH="/pgtop/tmp_install/usr/local/pgsql/bin:$PATH" LD_LIBRARY_PATH="/pgtop/tmp_install/usr/local/pgsql/lib" bindir=/pgtop/tmp_install//usr/local/pgsql/bin /bin/sh test.sh The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. Cluster file encryption is enabled. creating directory /pgtop/src/test/crypto/tmp_check/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... America/New_York creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok Sync to disk skipped. The data directory might become corrupt if the operating system crashes. Success. You can now start the database server using: /pgtop/tmp_install/usr/local/pgsql/bin/pg_ctl -D /pgtop/src/test/crypto/tmp_check/data -l logfile start waiting for server to start.... done server started waiting for server to shut down.... done server stopped PASSED rm -rf '/usr/local/src/gen/pgsql/postgresql/src/test/crypto'/tmp_check /bin/mkdir -p '/usr/local/src/gen/pgsql/postgresql/src/test/crypto'/tmp_check cd . && TESTDIR='/usr/local/src/gen/pgsql/postgresql/src/test/crypto' PATH="/pgtop/tmp_install/usr/local/pgsql/bin:$PATH" LD_LIBRARY_PATH="/pgtop/tmp_install/usr/local/pgsql/lib" PGPORT='65432' PG_REGRESS='/usr/local/src/gen/pgsql/postgresql/src/test/crypto/../../../src/test/regress/pg_regress' REGRESS_SHLIB='/pgtop/src/test/regress/regress.so' /usr/bin/prove -I ../../../src/test/perl/ -I . t/*.pl t/001_testcrypto.pl .. ok t/002_testkw.pl ...... ok All tests successful. Files=2, Tests=10296, 138 wallclock secs ( 1.81 usr 0.22 sys + 26.55 cusr 24.02 csys = 52.60 CPU) Result: PASS