Skip to content

Test Mount API #2039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 21 commits into
base: dev
Choose a base branch
from

Conversation

daviewales
Copy link
Contributor

WIP branch adding tests to Mount API for various backends.

@buhtz
Copy link
Member

buhtz commented Feb 17, 2025

Great. I am most of the days offline until next week. But i am on it

@daviewales daviewales force-pushed the mount-refactor-1-test-encfstools branch from 372913c to beaf7ec Compare February 18, 2025 00:40
@daviewales
Copy link
Contributor Author

Note that it's still WIP. I've added high-level tests for the 'local' backend, as it's the simplest. I'll work on adding tests for the remaining backends.

@daviewales daviewales force-pushed the mount-refactor-1-test-encfstools branch from beaf7ec to 83e48f4 Compare February 18, 2025 01:09
@daviewales daviewales force-pushed the mount-refactor-1-test-encfstools branch from 83e48f4 to ab70e8b Compare February 18, 2025 01:19
@buhtz buhtz added this to the 1.6.0 (2nd release from now) milestone Feb 22, 2025
@buhtz buhtz added the High label Mar 31, 2025
@buhtz buhtz added the Code Quality About code quality, refactoring, (unit) testing, linting, ... label Apr 2, 2025
@buhtz
Copy link
Member

buhtz commented Apr 25, 2025

  • I updated the branch to the latest dev.
  • I kind of recreated the new encode.py file so that its git history (from encfstools.py) is preserved. Because of a Microsoft GitHub bug you wont see this history at GitHub. But in your local branch you should see its history back to year 2012/13 with git log --follow encode.py (the --follow is important!).
  • Add encode.py to the list of files that will be checked for all linter rules.
  • Some minor adjustments.

I really like your tests. I can read and understand them very well. This is high quality.
I will dive a bit deeper. But for today I am finished. So you can work on your branch if you want to. I'll be back later.

@buhtz
Copy link
Member

buhtz commented Apr 26, 2025

I don't understand the purpose of MountWithLocalEncFS.test_unconfigured_mount(). What is the difference between "unconfigured" and "configured" in context of EncFS?

@buhtz buhtz added the Feedback needs user response, may be closed after timeout without a response label Apr 26, 2025
@daviewales
Copy link
Contributor Author

Unconfigured corresponds to the first run, before the BiT configuration or the EncFS directory is initialised.

Configured corresponds to later runs, where there is a preexisting configuration and EncFS directory.

@buhtz
Copy link
Member

buhtz commented Apr 27, 2025

Unconfigured corresponds to the first run, before the BiT configuration or the EncFS directory is initialised.

Configured corresponds to later runs, where there is a preexisting configuration and EncFS directory.

There is this out-commented line in test_mount.py

# unconfigured_mount = mount.Mount(cfg=cfg, tmp_mount=True)

To my unerstanding cfg here is configured for local-encfs. So how can it be unconfigured. I still don't get it, sorry.

I don't know that the desired test result could be for test_unconfigured_mount(). But I also don't understand all the mount behavior of BIT. Have not touched that part of the code base ever.

If you can be more specific with your questions and needs I might be able to help.

@daviewales
Copy link
Contributor Author

daviewales commented May 13, 2025

I've had a chance to look at this. 'Unconfigured' in this case refers to the EncFS configuration, rather than the BackInTime configuration. Yes, the BackInTime configuration is reused, but the EncFS mount has not yet been created. Perhaps I should rename it to test_uninitialised_mount()?

Edit:

Specifically, an initialised backup location will contain the file .encfs6.xml, while an uninitialised backup location will not.

@buhtz
Copy link
Member

buhtz commented May 13, 2025

"uninitialized" sounds good to me.

The config module imports `password`. Previously, the `setPassword`
method used the conflicting argument name `password`, which shadowed the
name of the imported module. It also attemptd to _use_ the shadowed
module name if `self.pw` was None, which means that sometimes the method
would work, and sometimes it wouldn't.

I've resolved this by renaming the argument name to `password_value`.
@daviewales daviewales force-pushed the mount-refactor-1-test-encfstools branch from 9e6e18c to 0f1df2a Compare May 13, 2025 06:43
@buhtz
Copy link
Member

buhtz commented Jun 7, 2025

Hello David,
Can you please give me a short update about this PR?
Regards,
Christian

@daviewales
Copy link
Contributor Author

I haven't had much chance to work on the lately. The latest commit is work in progress, as the test I'm adding still needs some work to make it pass. In theory, it is supposed to create a new EncFS mount, and confirm that it was created.

@buhtz buhtz removed the Feedback needs user response, may be closed after timeout without a response label Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Quality About code quality, refactoring, (unit) testing, linting, ... High
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants