test(integration): remove sftp tests
This commit is contained in:
parent
9f10960621
commit
ce3b0e8430
6 changed files with 5 additions and 69 deletions
|
|
@ -10,10 +10,5 @@ RUN apt-get update && apt-get install -y \
|
||||||
netcat-openbsd \
|
netcat-openbsd \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN useradd -m davuser
|
|
||||||
|
|
||||||
# Enable user_allow_other for FUSE mounts
|
|
||||||
RUN echo "user_allow_other" >> /etc/fuse.conf
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,8 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=test
|
- NODE_ENV=test
|
||||||
- LOG_LEVEL=debug
|
- LOG_LEVEL=debug
|
||||||
command: tail -f /dev/null # Keep alive for exec
|
command: tail -f /dev/null
|
||||||
|
|
||||||
# Mock SMB Server
|
|
||||||
smb-server:
|
smb-server:
|
||||||
image: dperson/samba
|
image: dperson/samba
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -23,7 +22,6 @@ services:
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- /tmp/samba
|
- /tmp/samba
|
||||||
|
|
||||||
# Mock WebDAV Server
|
|
||||||
webdav-server:
|
webdav-server:
|
||||||
image: bytemark/webdav
|
image: bytemark/webdav
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -33,7 +31,6 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- webdav-data:/var/lib/dav/data
|
- webdav-data:/var/lib/dav/data
|
||||||
|
|
||||||
# Mock NFS Server
|
|
||||||
nfs-server:
|
nfs-server:
|
||||||
image: erichough/nfs-server
|
image: erichough/nfs-server
|
||||||
privileged: true
|
privileged: true
|
||||||
|
|
@ -43,15 +40,6 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- nfs-data:/exports
|
- nfs-data:/exports
|
||||||
|
|
||||||
# Mock SFTP Server
|
|
||||||
sftp-server:
|
|
||||||
image: atmoz/sftp
|
|
||||||
command: testuser:testpass:1001
|
|
||||||
volumes:
|
|
||||||
- sftp-data:/home/testuser
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
webdav-data:
|
webdav-data:
|
||||||
nfs-data:
|
nfs-data:
|
||||||
sftp-data:
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,5 +38,5 @@ describe("NFS Backend Integration", () => {
|
||||||
// 4. Unmount
|
// 4. Unmount
|
||||||
const unmountResult = await backend.unmount();
|
const unmountResult = await backend.unmount();
|
||||||
expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted);
|
expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted);
|
||||||
}, 60000);
|
}, 10000);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
import { describe, expect, it, beforeAll } from "bun:test";
|
|
||||||
import { makeSftpBackend } from "../../../server/modules/backends/sftp/sftp-backend";
|
|
||||||
import { BACKEND_STATUS } from "../../../schemas/volumes";
|
|
||||||
import * as fs from "node:fs/promises";
|
|
||||||
|
|
||||||
describe("SFTP Backend Integration", () => {
|
|
||||||
const mountPath = "/tmp/test-mount-sftp";
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
backend: "sftp" as const,
|
|
||||||
host: "sftp-server",
|
|
||||||
username: "testuser",
|
|
||||||
password: "testpass",
|
|
||||||
path: "",
|
|
||||||
port: 22,
|
|
||||||
skipHostKeyCheck: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
|
||||||
await fs.rm(mountPath, { recursive: true, force: true }).catch(() => {});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should mount, check health, and unmount successfully", async () => {
|
|
||||||
// SKIPPED: The atmoz/sftp Docker image sets restrictive permissions on the home
|
|
||||||
// directory that prevent writes even when mounting as root. This is a test infrastructure
|
|
||||||
// limitation, not an issue with the SFTP backend code itself. In production,
|
|
||||||
// SFTP servers typically have properly configured writable directories.
|
|
||||||
const backend = makeSftpBackend(config, mountPath);
|
|
||||||
|
|
||||||
// 1. Mount
|
|
||||||
const mountResult = await backend.mount();
|
|
||||||
expect(mountResult.status).toBe(BACKEND_STATUS.mounted);
|
|
||||||
|
|
||||||
// 2. Health Check
|
|
||||||
const healthResult = await backend.checkHealth();
|
|
||||||
expect(healthResult.status).toBe(BACKEND_STATUS.mounted);
|
|
||||||
|
|
||||||
// 3. Write/Read test - Write to writable directory
|
|
||||||
const testFile = `${mountPath}/test-sftp-${Date.now()}.txt`;
|
|
||||||
await fs.writeFile(testFile, "hello from sftp integration");
|
|
||||||
const content = await fs.readFile(testFile, "utf-8");
|
|
||||||
expect(content).toBe("hello from sftp integration");
|
|
||||||
|
|
||||||
// 4. Unmount
|
|
||||||
const unmountResult = await backend.unmount();
|
|
||||||
expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted);
|
|
||||||
}, 60000);
|
|
||||||
});
|
|
||||||
|
|
@ -45,5 +45,5 @@ describe("WebDAV Backend Integration", () => {
|
||||||
// 4. Unmount
|
// 4. Unmount
|
||||||
const unmountResult = await backend.unmount();
|
const unmountResult = await backend.unmount();
|
||||||
expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted);
|
expect(unmountResult.status).toBe(BACKEND_STATUS.unmounted);
|
||||||
}, 60000);
|
}, 10000);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@
|
||||||
"test": "bun run test:server && bun run test:client",
|
"test": "bun run test:server && bun run test:client",
|
||||||
"test:e2e": "NODE_ENV=test dotenv -e .env.local -- playwright test",
|
"test:e2e": "NODE_ENV=test dotenv -e .env.local -- playwright test",
|
||||||
"test:e2e:ui": "NODE_ENV=test dotenv -e .env.local -- playwright test --ui",
|
"test:e2e:ui": "NODE_ENV=test dotenv -e .env.local -- playwright test --ui",
|
||||||
"test:codegen": "playwright codegen localhost:4096"
|
"test:codegen": "playwright codegen localhost:4096",
|
||||||
|
"test:integration": "app/test/integration/backends/run.sh"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue