Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-6138

RealmsTestCase.testFilesystemRealmIntegrity() fails when run twice with no clean

XMLWordPrintable

      RealmsTestCase.testFilesystemRealmIntegrity() tries to create an identity for "user3", which will fail if the test is run twice with no intervening clean to remove the identity file from the previous run:

      [ERROR] Tests run: 14, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 5.689 s <<< FAILURE! - in org.wildfly.extension.elytron.RealmsTestCase
      [ERROR] testFilesystemRealmIntegrity(org.wildfly.extension.elytron.RealmsTestCase)  Time elapsed: 0.603 s  <<< ERROR!
      org.wildfly.security.auth.server.RealmUnavailableException: ELY01024: Filesystem-backed realm cannot create duplicate identity for identity "user3"
      	at org.wildfly.security.auth.realm.FileSystemSecurityRealm$Identity.createPrivileged(FileSystemSecurityRealm.java:874)
      	at org.wildfly.security.auth.realm.FileSystemSecurityRealm$Identity.create(FileSystemSecurityRealm.java:808)
      	at org.wildfly.extension.elytron.RealmsTestCase.testFilesystemRealmIntegrity(RealmsTestCase.java:428)
      Caused by: java.nio.file.FileAlreadyExistsException: /Users/bstansberry/dev/wildfly/wildfly-core/elytron/target/test-classes/org/wildfly/extension/elytron/filesystem-realm-integrity/u/user3-OVZWK4RT.xml -> /Users/bstansberry/dev/wildfly/wildfly-core/elytron/target/test-classes/org/wildfly/extension/elytron/filesystem-realm-integrity/u/user3-OVZWK4RT.xml.VT7TKYEETSH7
      	at java.base/java.nio.file.Files.createLink(Files.java:1102)
      	at org.wildfly.security.auth.realm.FileSystemSecurityRealm$Identity.createPrivileged(FileSystemSecurityRealm.java:867)
      	... 2 more
      

      Solution is to remove any existing file before running this part of the test.

            bstansbe@redhat.com Brian Stansberry
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: