[Git][java-team/libmina-sshd-java][master] 2 commits: Looping over FileStore's instead of using getFileStore(Path)

Pierre Gruet (@pgt) gitlab at salsa.debian.org
Thu Jan 23 05:59:04 GMT 2025



Pierre Gruet pushed to branch master at Debian Java Maintainers / libmina-sshd-java


Commits:
4ceb647d by Pierre Gruet at 2025-01-23T00:11:18+01:00
Looping over FileStore's instead of using getFileStore(Path)

- - - - -
69943370 by Pierre Gruet at 2025-01-23T00:11:31+01:00
Upload to unstable

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/handling_FileStore.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+libmina-sshd-java (2.13.2-2) unstable; urgency=medium
+
+  * Looping over FileStore's instead of using getFileStore(Path)
+
+ -- Pierre Gruet <pgt at debian.org>  Thu, 23 Jan 2025 00:11:22 +0100
+
 libmina-sshd-java (2.13.2-1) unstable; urgency=medium
 
   * New upstream version 2.13.2


=====================================
debian/patches/handling_FileStore.patch
=====================================
@@ -0,0 +1,70 @@
+Description: loopiing over available FileStore's instead of using
+ java.nio.file.Files.getFileStore(Path) in a test, which leads to build
+ failures on Debian buildds under certain conditions
+Author: Pierre Gruet <pgt at debian.org>
+Bug-Debian: https://bugs.debian.org/1074355
+Forwarded: no
+Last-Update: 2025-01-23
+
+--- a/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/extensions/helpers/SpaceAvailableExtensionImplTest.java
++++ b/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/extensions/helpers/SpaceAvailableExtensionImplTest.java
+@@ -63,34 +63,35 @@
+         Path lclSftp = CommonTestSupportUtils.resolve(targetPath, SftpConstants.SFTP_SUBSYSTEM_NAME, getClass().getSimpleName(),
+                 getCurrentTestName());
+         Path parentPath = targetPath.getParent();
+-        FileStore store = Files.getFileStore(lclSftp.getRoot());
+-        final String queryPath = CommonTestSupportUtils.resolveRelativeRemotePath(parentPath, lclSftp);
+-        final SpaceAvailableExtensionInfo expected = new SpaceAvailableExtensionInfo(store);
++        for (FileStore store: lclSftp.getRoot().getFileSystem().getFileStores()) {
++            final String queryPath = CommonTestSupportUtils.resolveRelativeRemotePath(parentPath, lclSftp);
++            final SpaceAvailableExtensionInfo expected = new SpaceAvailableExtensionInfo(store);
+ 
+-        List<? extends SubsystemFactory> factories = sshd.getSubsystemFactories();
+-        sshd.setSubsystemFactories(Collections.singletonList(new SftpSubsystemFactory() {
+-            @Override
+-            public Command createSubsystem(ChannelSession channel) throws IOException {
+-                return new SftpSubsystem(channel, this) {
+-                    @Override
+-                    protected SpaceAvailableExtensionInfo doSpaceAvailable(int id, String path) throws IOException {
+-                        if (!queryPath.equals(path)) {
+-                            throw new StreamCorruptedException(
+-                                    "Mismatched query paths: expected=" + queryPath + ", actual=" + path);
++            List<? extends SubsystemFactory> factories = sshd.getSubsystemFactories();
++            sshd.setSubsystemFactories(Collections.singletonList(new SftpSubsystemFactory() {
++                @Override
++                public Command createSubsystem(ChannelSession channel) throws IOException {
++                    return new SftpSubsystem(channel, this) {
++                        @Override
++                        protected SpaceAvailableExtensionInfo doSpaceAvailable(int id, String path) throws IOException {
++                            if (!queryPath.equals(path)) {
++                                throw new StreamCorruptedException(
++                                        "Mismatched query paths: expected=" + queryPath + ", actual=" + path);
++                            }
++
++                            return expected;
+                         }
++                    };
++                }
++            }));
+ 
+-                        return expected;
+-                    }
+-                };
++            try (SftpClient sftp = createSingleSessionClient()) {
++                SpaceAvailableExtension ext = assertExtensionCreated(sftp, SpaceAvailableExtension.class);
++                SpaceAvailableExtensionInfo actual = ext.available(queryPath);
++                assertEquals("Mismatched information", expected, actual);
++            } finally {
++                sshd.setSubsystemFactories(factories);
+             }
+-        }));
+-
+-        try (SftpClient sftp = createSingleSessionClient()) {
+-            SpaceAvailableExtension ext = assertExtensionCreated(sftp, SpaceAvailableExtension.class);
+-            SpaceAvailableExtensionInfo actual = ext.available(queryPath);
+-            assertEquals("Mismatched information", expected, actual);
+-        } finally {
+-            sshd.setSubsystemFactories(factories);
+         }
+     }
+ }


=====================================
debian/patches/series
=====================================
@@ -6,3 +6,4 @@ overriding_IoHandler.patch
 skip_tests_requiring_networks.patch
 missing_test_classes.patch
 skip_reruns.patch
+handling_FileStore.patch



View it on GitLab: https://salsa.debian.org/java-team/libmina-sshd-java/-/compare/86f6094f52b99f5543ce39671ed574188f3d9934...69943370a8e7f8337ee8350c31fe13d71ba09f9e

-- 
View it on GitLab: https://salsa.debian.org/java-team/libmina-sshd-java/-/compare/86f6094f52b99f5543ce39671ed574188f3d9934...69943370a8e7f8337ee8350c31fe13d71ba09f9e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20250123/f509ea15/attachment.htm>


More information about the pkg-java-commits mailing list