Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bUxgz-0003BY-Qr for pgadmin-hackers@arkaria.postgresql.org; Wed, 03 Aug 2016 15:02:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bUxgz-0001tl-Da for pgadmin-hackers@arkaria.postgresql.org; Wed, 03 Aug 2016 15:02:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bUxgy-0001rk-J3 for pgadmin-hackers@postgresql.org; Wed, 03 Aug 2016 15:02:44 +0000 Received: from mail-io0-x233.google.com ([2607:f8b0:4001:c06::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bUxgr-0003Jm-F6 for pgadmin-hackers@postgresql.org; Wed, 03 Aug 2016 15:02:43 +0000 Received: by mail-io0-x233.google.com with SMTP id 38so245666222iol.0 for ; Wed, 03 Aug 2016 08:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=bG32ugt0h/7CpB6Uw80cDjeg/i7MEnzrAk864HQh5vo=; b=X4Ko6QZr+xcrq2fBbH9XlOKgKBUC+C1Rhtj6BmQNmFZppXnNd6JMYuUhaqvOF4UIWV o1oj7v2DNRIgLZWPMGM6YQ3sPxePXg3gjul8v/djrTfdutSA710QUeew8vzY4XBZpzfB 5OdYEnN4DVN6MDXnLd8EdEAfuP7bx8A6v2bnWT/rDajfTb0CPM7oIi+Jvq98Kf+6s03n /2Zn5UyHsgt70g8v3/d/1TiDX84L9s7ZLRkPWbY2zpETvtueh9KAEgTUkMUTRKdkvQ0g tZwCZMkDVRxkkRwYxPKfY3SIF5RjhQ3M8RcOv68awJQpVriCy1ZJ86SgoBPJv8eg8qSK iWjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=bG32ugt0h/7CpB6Uw80cDjeg/i7MEnzrAk864HQh5vo=; b=hI/lbjoE4vcXLRxgJPAnMb7pkEgb2EujRpeMShu8g9dRNtuZJKuRMMHC3yr12tCOSu ZXUuRkU02vxuFDNgI7iCVFClIobbSP/wutmAWhxxHy8dQNGdqjdTq1G16muOuRIztZMN kj1LcUDWUZa/A/euYcg6OkKtN93PH5XEg6gNd4RHGOHZhQTgpKi1aXcvJ2Y6Dd93udBN Py5279LBjf7FzAYLFAwz3/Yr44v+868Zouo8a20ycWR4Z9b8wluOjVHCxUiQhBgRRO80 MHbpzAIiVibAJE6ruKumFYvnhOmkVBV2YyiHZP8Q4lfEh/ednHNwVG/E39EeK0Astp5G YaPg== X-Gm-Message-State: AEkoouvy5EB1KxjYIKj8HudDdzXEcoqArj4Aw4vYqa9whzMEsGWI+sJRPhYpzO3fe3JFreKPI3IrOLLgIB86iZEiYA1Yak+C6A7uKLR+zxtL6nh3iodSSJcKyE3DtW7ghKGleW4WSEQJuKnG8UIoSO8kSY0T4e4C2di9eATbL8YA5+IxZPCDBS5hocSxGggFtrokChEuTg== X-Received: by 10.107.147.138 with SMTP id v132mr69087224iod.27.1470236556384; Wed, 03 Aug 2016 08:02:36 -0700 (PDT) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com. [209.85.214.41]) by smtp.gmail.com with ESMTPSA id f126sm3688577ith.7.2016.08.03.08.02.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Aug 2016 08:02:35 -0700 (PDT) Received: by mail-it0-f41.google.com with SMTP id u186so300239207ita.0 for ; Wed, 03 Aug 2016 08:02:35 -0700 (PDT) X-Received: by 10.36.51.206 with SMTP id k197mr49421512itk.37.1470236554951; Wed, 03 Aug 2016 08:02:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.208.97 with HTTP; Wed, 3 Aug 2016 08:02:33 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Wed, 3 Aug 2016 16:02:33 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pgAdmin IV : Unittest modular patch To: Navnath Gadakh Cc: pgadmin-hackers , Kanchan Mohitey Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org On Wed, Aug 3, 2016 at 2:01 PM, Navnath Gadakh wrote: > Hi Dave, > Thanks for clarification. > > On Wed, Aug 3, 2016 at 2:45 PM, Dave Page > wrote: >> >> Hi Navnath >> >> On Tue, Aug 2, 2016 at 3:58 PM, Navnath Gadakh >> wrote: >> > Hi Dave, >> > Please find the attached patch. >> > This patch includes: >> > 1. API test cases for Roles & Tablespaces node(Completed nodes: server >> > groups, servers, databases) >> > You can run test-suite using following command >> > for roles node >> > python regression/runtests.py --pkg >> > browser.server_groups.servers.roles >> > for tablespaces node >> > python regression/runtests.py --pkg >> > browser.server_groups.servers.tablespaces >> > for all nodes >> > python regression/runtests.py >> > You can also test with multiple servers. >> > 2. Delete database code in some of the missed test files. >> > 3. Added advanced configurations in test_advanced_config.json.in for >> > roles & >> > tablespaces. So, accordingly you need change the file >> > test_advanced_config.json >> > 4. Added one test user credentials in test_config.json.in to test the >> > =E2=80=98valid >> > password=E2=80=99 test case which is present in >> > browser/tests/test_change_password.py >> > Why test user credentials in test_config.json.in? >> > Currently, I am getting =E2=80=98UnicodeDecodeError=E2=80= =99 when I run >> > test-suite(runtests.py) with existing code. I already explained the >> > detail >> > about this error in RM(#1521). I am creating test user to test the >> > =E2=80=98valid >> > password=E2=80=99 test case. >> >> The tablespace test is one that I think is going to cause us problems >> - we really can't have a hard-coded path in the config; > > Understood. >> >> >> - It might need to be different for each server being tested >> Current patch supports multiple servers if you add tablespace >> configurations for multiple servers. In the current patch, it's only for= one >> server. > > For multiple servers you need to add multiple tablespace > configuration: > "test_tablespc_credentials":[{ > "test_tblspace_name": "test_tablespace", > "test_spc_location": "/Library/PostgreSQL/9.6/data", > "test_spc_opts": [], > "test_spc_user": "XXXXX" > }, > "test_tblspace_name": "test_tablespace1", > "test_spc_seclable": [], > "test_spc_location": "/Library/PostgrePlus/9.4AS/data", > "test_spc_opts": [], > "test_spc_user": "YYYYY" > }] > Anyhow, we are not going to use a hard coded path. Oh - does the per-server config override the main config? That's useful. So anything that's in test_advanced_config.py can be overridden on a per-server basis in test_config.py? >> - It is very likely to be different for each user >> >> I think what we need to do is: >> >> - Skip the tests if the server is not connected via a Unix domain >> socket (hostname starts with /), 127.0.0.1 or ::1. > > Understood. Please output a notice saying the test was skipped, and note it in the summary as well (as we're planning to do with failed tests). >> >> - Add per-server configuration options for the tablespace path and >> service account under which the database server runs. These values >> should default to /tmp and postgres for a PostgreSQL server, and edb >> for PPAS. > > Ok. For server connected via Unix domain socket. As per my understand= ing > modified configuration should be, > "tablespc_credentials":[{ > "tblspace_name": "tablespace1", > "testspc_seclable": [], > "spc_acl": [ > { > "grantee":"postgres", > "grantor":"postgres", > "privileges":[ > { > "privilege_type":"C", > "privilege":true, > "with_grant":false > } > ] > } > ], > "spc_location": "/tmp", > "spc_opts": [], > "spc_user": "postgres", > "service_account": "test1_user" > },{ > "tblspace_name": "tablespace2", > "spc_seclable": [], > "spc_acl": [ > { > "grantee":"enterprisedb", > "grantor":"enterprisedb", > "privileges":[ > { > "privilege_type":"C", > "privilege":true, > "with_grant":false > } > ] > } > ], > "spc_location": "/tmp", > "spc_opts": [], > "spc_user": "enterprisedb", > "service_account": "test2_user" > }] > Please correct me if I am wrong. Something like that yes - though service_account seems pointless given your comment below... >> - Otherwise; assume the server is on the local machine, and: >> - Create /$tblspace_path// >> - chown $service_account /$tblspace_path// >> - Run the tests > > We can't set the owner for a tablespace path directory using normal > user, the user should be 'root' > Say, I am logged in my machine as a 'abc' user & I have installed > PostgreSQL9.5 with 'postgres' user. > It won't run chown postgres > /$tablespace_path_for_PostgreSQL9.5/ Aww crap. Yeah :-(. OK in that case let's have the user specify (and create) the path themselves for each server. If they don't specify a path, then skip the test. In fact - you might as well only skip the test in that case, and forget about the address check above. --=20 Dave Page VP, Chief Architect, Tools & Installers EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company Blog: http://pgsnake.blogspot.com Twitter: @pgsnake --=20 Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers