18874: Use test auth instead of adding real accounts on test host.
authorTom Clegg <tom@curii.com>
Tue, 7 Nov 2023 20:14:49 +0000 (15:14 -0500)
committerTom Clegg <tom@curii.com>
Tue, 7 Nov 2023 20:14:49 +0000 (15:14 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/workbench2/cypress/integration/login.spec.js
services/workbench2/tools/arvados_config.yml

index 2c539e4902aa36f2c9687adcc380af44d0b35dde..79f73670a34b055141974ba7da8bec0eef1ea22c 100644 (file)
@@ -27,17 +27,10 @@ describe('Login tests', function() {
             .as('inactiveUser').then(function() {
                 inactiveUser = this.inactiveUser;
             }
-        );
-        randomUser.username = `randomuser${Math.floor(Math.random() * 999999)}`;
-        randomUser.password = {
-            crypt: 'zpAReoZzPnwmQ',
-            clear: 'topsecret',
-        };
-        cy.exec(`useradd ${randomUser.username} -p ${randomUser.password.crypt}`);
-    })
-
-    after(function() {
-        cy.exec(`userdel ${randomUser.username}`);
+                                    );
+        // Username/password match Login.Test section of arvados_config.yml
+        randomUser.username = 'randomuser1234';
+        randomUser.password = 'topsecret';
     })
 
     beforeEach(function() {
@@ -128,14 +121,14 @@ describe('Login tests', function() {
         cy.get('#username').type(randomUser.username);
         cy.get('#password').type('wrong password');
         cy.get("button span:contains('Log in')").click();
-        cy.get('p#password-helper-text').should('contain', 'PAM: Authentication failure');
+        cy.get('p#password-helper-text').should('contain', 'authentication failed');
         cy.url().should('not.contain', '/projects/');
     })
 
     it('successfully authenticates using the login form', function() {
         cy.visit('/');
         cy.get('#username').type(randomUser.username);
-        cy.get('#password').type(randomUser.password.clear);
+        cy.get('#password').type(randomUser.password);
         cy.get("button span:contains('Log in')").click();
         cy.url().should('contain', '/projects/');
         cy.get('div#root').should('contain', 'Arvados Workbench (zzzzz)');
index 1ef77b86ce8aa6b71e58ea83e91c9eec31bcf32f..ba41c51b639cf072216936d30d10ecae2f64b7ef 100644 (file)
@@ -18,8 +18,12 @@ Clusters:
         original_owner_uuid: {Function: original_owner, Protected: true}
     Login:
       TrustPrivateNetworks: true
-      PAM:
+      Test:
         Enable: true
+        Users:
+          randomuser1234:
+            Email: randomuser1234@example.invalid
+            Password: topsecret
     StorageClasses:
       default:
         Default: true