Skip to content

tests: repo: fix repo discovery tests on overlayfs#4232

Merged
ethomson merged 1 commit into
libgit2:masterfrom
pks-t:pks/schroot-test-fixes
May 4, 2017
Merged

tests: repo: fix repo discovery tests on overlayfs#4232
ethomson merged 1 commit into
libgit2:masterfrom
pks-t:pks/schroot-test-fixes

Conversation

@pks-t
Copy link
Copy Markdown
Member

@pks-t pks-t commented May 3, 2017

Debian and Ubuntu often use schroot to build their DEB packages in a
controlled environment. Depending on how schroot is configured, our
tests regarding repository discovery break due to not being able to find
the repositories anymore. It turns out that these errors occur when the
schroot is configured to use an overlayfs on the directory structures.

The reason for this failure is that we usually refrain from discovering
repositories across devices. But unfortunately, overlayfs does not have
consistent device identifiers for all its files but will instead use the
device number of the filesystem the file stems from. So whenever we
cross boundaries between the upper and lower layer of the overlay, we
will fail to properly detect the repository and bail out.

This commit fixes the issue by enabling cross-device discovery in our
tests. While it would be preferable to have this turned off, it probably
won't do much harm anyway as we set up our tests in a temporary location
outside of the parent repository.

Debian and Ubuntu often use schroot to build their DEB packages in a
controlled environment. Depending on how schroot is configured, our
tests regarding repository discovery break due to not being able to find
the repositories anymore. It turns out that these errors occur when the
schroot is configured to use an overlayfs on the directory structures.

The reason for this failure is that we usually refrain from discovering
repositories across devices. But unfortunately, overlayfs does not have
consistent device identifiers for all its files but will instead use the
device number of the filesystem the file stems from. So whenever we
cross boundaries between the upper and lower layer of the overlay, we
will fail to properly detect the repository and bail out.

This commit fixes the issue by enabling cross-device discovery in our
tests. While it would be preferable to have this turned off, it probably
won't do much harm anyway as we set up our tests in a temporary location
outside of the parent repository.
@pks-t
Copy link
Copy Markdown
Member Author

pks-t commented May 3, 2017

This fixes #4186.

I took a look at also fixing checkout::tree::extremeley_long_file_name and status::worktree::long_filenames with schroot and aufs, but it requires quite a lot of trimming on the file names (some 20 to 30 bytes less). This is required as aufs supports a shorter maximum file length than most other filesystems. Considering it is possible to build with overlayfs with these fixes here I don't think we should compromise the general test case for a single rather obscure file system, though, so I refrained.

@ethomson
Copy link
Copy Markdown
Member

ethomson commented May 4, 2017

I don't think we should compromise the general test case for a single rather obscure file system, though, so I refrained.

👍

@ethomson ethomson merged commit 1b6ab16 into libgit2:master May 4, 2017
@cschultz702
Copy link
Copy Markdown

Thank you for this

@pks-t pks-t deleted the pks/schroot-test-fixes branch June 6, 2017 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants