Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-816

Fix test_file_readonly_change on macOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2.323
    • Fix Version/s: 3.0.4
    • Component/s: Tests

      Description

      [INFO]      [exec] FAIL nuxeo-drive-client/tests/test_readonly.py::TestReadOnly::test_file_readonly_change
      [INFO]      [exec] =================================== FAILURES ===================================
      [INFO]      [exec] ____________________ TestReadOnly.test_file_readonly_change ____________________
      [INFO]      [exec] self = <tests.test_readonly.TestReadOnly testMethod=test_file_readonly_change>
      [INFO]      [exec]     @skipIf(AbstractOSIntegration.is_windows(),
      [INFO]      [exec]             'Readonly folder let new file creation')
      [INFO]      [exec]     def test_file_readonly_change(self):
      [INFO]      [exec]         local = self.local_client_1
      [INFO]      [exec]         remote = self.remote_document_client_1
      [INFO]      [exec]         # Create documents in the remote root workspace
      [INFO]      [exec]         # then synchronize
      [INFO]      [exec]         remote.make_folder('/', 'Test folder')
      [INFO]      [exec]         remote.make_file('/Test folder', 'joe.odt', 'Some content')
      [INFO]      [exec]         remote.make_file('/Test folder', 'jack.odt', 'Some content')
      [INFO]      [exec]         remote.make_folder('/Test folder', 'Sub folder 1')
      [INFO]      [exec]         remote.make_file('/Test folder/Sub folder 1', 'sub file 1.txt',
      [INFO]      [exec]                          'Content')
      [INFO]      [exec]         self._set_readonly_permission(self.user_1, TEST_WORKSPACE_PATH + '/Test folder', True)
      [INFO]      [exec]         self.wait_sync(wait_for_async=True)
      [INFO]      [exec]         self.assertTrue(local.exists('/Test folder'))
      [INFO]      [exec]         self.assertTrue(local.exists('/Test folder/joe.odt'))
      [INFO]      [exec]         self.assertTrue(local.exists('/Test folder/jack.odt'))
      [INFO]      [exec]         self.assertTrue(local.exists('/Test folder/Sub folder 1'))
      [INFO]      [exec]         self.assertTrue(local.exists('/Test folder/Sub folder 1/sub file 1.txt'))
      [INFO]      [exec]         # Update the content on the server
      [INFO]      [exec]         self.root_remote_client.update_content(TEST_WORKSPACE_PATH + '/Test folder/joe.odt',
      [INFO]      [exec]                                                'Some remotely updated content', 'joe.odt')
      [INFO]      [exec]         self.wait_sync(wait_for_async=True)
      [INFO]      [exec]         self.assertTrue(local.get_content('/Test folder/joe.odt'), 'Some remotely updated content')
      [INFO]      [exec]         # Remove the readonly
      [INFO]      [exec]         self._set_readonly_permission(self.user_1, TEST_WORKSPACE_PATH + '/Test folder', False)
      [INFO]      [exec]         self.wait_sync(wait_for_async=True)
      [INFO]      [exec]         fname = os.path.join(self.sync_root_folder_1, 'Test folder', 'test.txt')
      [INFO]      [exec]         fname2 = os.path.join(self.sync_root_folder_1, 'Test folder', 'Sub folder 1', 'test.txt')
      [INFO]      [exec]         # Check it works
      [INFO]      [exec]         self.assertTrue(self.touch(fname))
      [INFO]      [exec]         self.assertTrue(self.touch(fname2))
      [INFO]      [exec]         # First remove the files
      [INFO]      [exec]         os.remove(fname)
      [INFO]      [exec]         os.remove(fname2)
      [INFO]      [exec]         # Put it back readonly
      [INFO]      [exec]         self._set_readonly_permission(self.user_1, TEST_WORKSPACE_PATH + '/Test folder', True)
      [INFO]      [exec]         self.wait_sync(wait_for_async=True)
      [INFO]      [exec]         # Check it works
      [INFO]      [exec]         self.assertFalse(self.touch(fname))
      [INFO]      [exec] >       self.assertFalse(self.touch(fname2))
      [INFO]      [exec] E       AssertionError: True is not false
      [INFO]      [exec] fname      = '/Users/hudson/tmp/0ebd1d51/workspace/Drive_FT-drive_master-CUACR5UOIAO62W7K2CAAQ7UISS5UUL3SF5V2PSVOUZC4CRBQLRIA/tmp/tmpNb18hTdrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/test.txt'
      [INFO]      [exec] fname2     = '/Users/hudson/tmp/0ebd1d51/workspace/Drive_FT-drive_master-CUACR5UOIAO62W7K2CAAQ7UISS5UUL3SF5V2PSVOUZC4CRBQLRIA/tmp/tmpNb18hTdrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/Sub folder 1/test.txt'
      [INFO]      [exec] local      = <tests.mac_local_client.MacLocalClient object at 0x10d219ed0>
      [INFO]      [exec] remote     = <RemoteDocumentClient base_folder=None, blob_timeout=60, check_suspended=None,...UL3SF5V2PSVOUZC4CRBQLRIA/tmp/tmpa4rLgi-nxdrive-uploads', user_id='driveuser_1'>
      [INFO]      [exec] self       = <tests.test_readonly.TestReadOnly testMethod=test_file_readonly_change>
      [INFO]      [exec] nuxeo-drive-client/tests/test_readonly.py:137: AssertionError
      

        Attachments

          Activity

            People

            • Assignee:
              mschoentgen Mickaël Schoentgen
              Reporter:
              mschoentgen Mickaël Schoentgen
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h