mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
bin/ no more accessible in github actions?
This commit is contained in:
@@ -572,10 +572,10 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||||
fn test_host_localhost_new() {
|
fn test_host_localhost_new() {
|
||||||
let host: Localhost = Localhost::new(PathBuf::from("/bin")).ok().unwrap();
|
let host: Localhost = Localhost::new(PathBuf::from("/dev")).ok().unwrap();
|
||||||
assert_eq!(host.wrkdir, PathBuf::from("/bin"));
|
assert_eq!(host.wrkdir, PathBuf::from("/dev"));
|
||||||
// Scan dir
|
// Scan dir
|
||||||
let entries = std::fs::read_dir(PathBuf::from("/bin").as_path()).unwrap();
|
let entries = std::fs::read_dir(PathBuf::from("/dev").as_path()).unwrap();
|
||||||
let mut counter: usize = 0;
|
let mut counter: usize = 0;
|
||||||
for _ in entries {
|
for _ in entries {
|
||||||
counter = counter + 1;
|
counter = counter + 1;
|
||||||
@@ -608,16 +608,16 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||||
fn test_host_localhost_pwd() {
|
fn test_host_localhost_pwd() {
|
||||||
let host: Localhost = Localhost::new(PathBuf::from("/bin")).ok().unwrap();
|
let host: Localhost = Localhost::new(PathBuf::from("/dev")).ok().unwrap();
|
||||||
assert_eq!(host.pwd(), PathBuf::from("/bin"));
|
assert_eq!(host.pwd(), PathBuf::from("/dev"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||||
fn test_host_localhost_list_files() {
|
fn test_host_localhost_list_files() {
|
||||||
let host: Localhost = Localhost::new(PathBuf::from("/bin")).ok().unwrap();
|
let host: Localhost = Localhost::new(PathBuf::from("/dev")).ok().unwrap();
|
||||||
// Scan dir
|
// Scan dir
|
||||||
let entries = std::fs::read_dir(PathBuf::from("/bin").as_path()).unwrap();
|
let entries = std::fs::read_dir(PathBuf::from("/dev").as_path()).unwrap();
|
||||||
let mut counter: usize = 0;
|
let mut counter: usize = 0;
|
||||||
for _ in entries {
|
for _ in entries {
|
||||||
counter = counter + 1;
|
counter = counter + 1;
|
||||||
@@ -645,7 +645,7 @@ mod tests {
|
|||||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn test_host_localhost_change_dir_failed() {
|
fn test_host_localhost_change_dir_failed() {
|
||||||
let mut host: Localhost = Localhost::new(PathBuf::from("/bin")).ok().unwrap();
|
let mut host: Localhost = Localhost::new(PathBuf::from("/dev")).ok().unwrap();
|
||||||
let new_dir: PathBuf = PathBuf::from("/omar/gabber/123/456");
|
let new_dir: PathBuf = PathBuf::from("/omar/gabber/123/456");
|
||||||
assert!(host.change_wrkdir(new_dir.as_path()).is_ok());
|
assert!(host.change_wrkdir(new_dir.as_path()).is_ok());
|
||||||
}
|
}
|
||||||
@@ -653,7 +653,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||||
fn test_host_localhost_open_read() {
|
fn test_host_localhost_open_read() {
|
||||||
let host: Localhost = Localhost::new(PathBuf::from("/bin")).ok().unwrap();
|
let host: Localhost = Localhost::new(PathBuf::from("/dev")).ok().unwrap();
|
||||||
// Create temp file
|
// Create temp file
|
||||||
let file: tempfile::NamedTempFile = create_sample_file();
|
let file: tempfile::NamedTempFile = create_sample_file();
|
||||||
assert!(host.open_file_read(file.path()).is_ok());
|
assert!(host.open_file_read(file.path()).is_ok());
|
||||||
@@ -663,7 +663,7 @@ mod tests {
|
|||||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn test_host_localhost_open_read_err_no_such_file() {
|
fn test_host_localhost_open_read_err_no_such_file() {
|
||||||
let host: Localhost = Localhost::new(PathBuf::from("/bin")).ok().unwrap();
|
let host: Localhost = Localhost::new(PathBuf::from("/dev")).ok().unwrap();
|
||||||
assert!(host
|
assert!(host
|
||||||
.open_file_read(PathBuf::from("/bin/foo-bar-test-omar-123-456-789.txt").as_path())
|
.open_file_read(PathBuf::from("/bin/foo-bar-test-omar-123-456-789.txt").as_path())
|
||||||
.is_ok());
|
.is_ok());
|
||||||
@@ -672,7 +672,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||||
fn test_host_localhost_open_read_err_not_accessible() {
|
fn test_host_localhost_open_read_err_not_accessible() {
|
||||||
let host: Localhost = Localhost::new(PathBuf::from("/bin")).ok().unwrap();
|
let host: Localhost = Localhost::new(PathBuf::from("/dev")).ok().unwrap();
|
||||||
let file: tempfile::NamedTempFile = create_sample_file();
|
let file: tempfile::NamedTempFile = create_sample_file();
|
||||||
//let mut perms = fs::metadata(file.path())?.permissions();
|
//let mut perms = fs::metadata(file.path())?.permissions();
|
||||||
fs::set_permissions(file.path(), PermissionsExt::from_mode(0o222)).unwrap();
|
fs::set_permissions(file.path(), PermissionsExt::from_mode(0o222)).unwrap();
|
||||||
@@ -683,7 +683,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||||
fn test_host_localhost_open_write() {
|
fn test_host_localhost_open_write() {
|
||||||
let host: Localhost = Localhost::new(PathBuf::from("/bin")).ok().unwrap();
|
let host: Localhost = Localhost::new(PathBuf::from("/dev")).ok().unwrap();
|
||||||
// Create temp file
|
// Create temp file
|
||||||
let file: tempfile::NamedTempFile = create_sample_file();
|
let file: tempfile::NamedTempFile = create_sample_file();
|
||||||
assert!(host.open_file_write(file.path()).is_ok());
|
assert!(host.open_file_write(file.path()).is_ok());
|
||||||
@@ -692,7 +692,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
#[cfg(any(target_os = "unix", target_os = "macos", target_os = "linux"))]
|
||||||
fn test_host_localhost_open_write_err() {
|
fn test_host_localhost_open_write_err() {
|
||||||
let host: Localhost = Localhost::new(PathBuf::from("/bin")).ok().unwrap();
|
let host: Localhost = Localhost::new(PathBuf::from("/dev")).ok().unwrap();
|
||||||
let file: tempfile::NamedTempFile = create_sample_file();
|
let file: tempfile::NamedTempFile = create_sample_file();
|
||||||
//let mut perms = fs::metadata(file.path())?.permissions();
|
//let mut perms = fs::metadata(file.path())?.permissions();
|
||||||
fs::set_permissions(file.path(), PermissionsExt::from_mode(0o444)).unwrap();
|
fs::set_permissions(file.path(), PermissionsExt::from_mode(0o444)).unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user