# X11 Forwarding Test Plan
## Prerequisites
- [ ] XQuartz installed (macOS) or X11 server running (Linux)
- [ ] DISPLAY environment variable set
- [ ] Test server with X11 applications installed
## Basic Functionality Tests
### 1. Connection Test
```bash
# Start local X11 server
# macOS: Open XQuartz
# Linux: X server usually running
# Check DISPLAY is set
echo $DISPLAY # Should show :0 or similar
# Connect with X11 forwarding
./target/release/qssh -X user@localhost
# On remote, check DISPLAY
echo $DISPLAY # Should show localhost:10.0 or similar
```
### 2. Simple X11 App Test
```bash
# Connect with X11
./target/release/qssh -X user@localhost
# Run simple X11 apps
xclock & # Should show clock window
xeyes & # Should show eyes following cursor
xcalc & # Should show calculator
```
### 3. Authentication Test
```bash
# Test untrusted mode (default -X)
./target/release/qssh -X user@localhost -c "xlogo"
# Test trusted mode (-Y)
./target/release/qssh -Y user@localhost -c "xlogo"
```
## VS Code Specific Tests
### Option 1: X11 Forwarding (Not Recommended)
```bash
# This would be SLOW and not ideal
./target/release/qssh -Y user@server -c "code"
# Issues to expect:
# - High latency
# - Rendering issues
# - Clipboard problems
# - Extensions might not work
```
### Option 2: Port Forwarding for code-server (Recommended)
```bash
# On server: Install code-server
# Start code-server on server
code-server --bind-addr 127.0.0.1:8080
# Connect with port forwarding
./target/release/qssh -L 8080:localhost:8080 user@server
# Open browser to http://localhost:8080
```
### Option 3: Future - VS Code Remote-SSH Compatibility
VS Code Remote-SSH expects:
- [x] Basic SSH connection
- [x] Command execution
- [x] SFTP support
- [ ] Connection multiplexing (not yet implemented)
- [ ] ControlMaster/ControlPath support (not yet implemented)
- [ ] Specific SSH protocol features
## Known Issues to Test
1. **Cookie Authentication**
- Verify MIT-MAGIC-COOKIE-1 is properly validated
- Test with invalid cookies (should reject)
2. **Multiple Connections**
- Test multiple X11 apps simultaneously
- Verify single_connection mode works
3. **Resource Cleanup**
- Ensure channels close properly
- Check for listener cleanup on disconnect
4. **Error Cases**
- X11 not available locally
- DISPLAY not set
- Port 6010-6099 all occupied
- Authentication failures
## Performance Tests
```bash
# Measure latency
time qssh -X user@localhost -c "xlogo -quit"
# Test with compression
time qssh -X -C user@localhost -c "xlogo -quit"
# Compare with OpenSSH
time ssh -X user@localhost -c "xlogo -quit"
```
## Security Tests
1. **Untrusted Mode Restrictions**
```bash
qssh -X user@localhost
xhost + import -window root screenshot.png ```
2. **Trusted Mode Permissions**
```bash
qssh -Y user@localhost
xhost + ```
## Integration Tests
```bash
# With SSH agent
qssh-agent
qssh-add ~/.qssh/id_qssh
qssh -X user@server # Should work without password
# With port forwarding
qssh -X -L 8080:localhost:8080 user@server # Both should work
```
## Expected Failures
These should NOT work yet:
- VS Code Remote-SSH extension (needs multiplexing)
- Heavy GUI apps might be unusably slow
- Some apps requiring special X11 extensions
## Bug Report Template
If testing fails:
1. Command run: `qssh -X ...`
2. Error message
3. DISPLAY value on client
4. DISPLAY value on server
5. X11 server type (XQuartz/Xorg version)
6. Application being tested
7. Network latency to server