Fuse-PerlSSH-FS

 view release on metacpan or  search on metacpan

lib/Fuse/PerlSSH/FS.pm  view on Meta::CPAN

					%flags = (replace => 1) if $_[3] > 1; # OR-ed constants are XATTR_CREATE 1, XATTR_REPLACE 2
					return File::ExtAttr::setfattr($_[0], $key, $_[2], { namespace => $ns, %flags }) or die "Cannot setfattr('$_[0]','$_[1]','$_[2]','$_[3]') - $!";
				},
				remote_removexattr => q{
					use File::ExtAttr;
					die "Cannot delfattr('$_[0]','$_[1]') - no namespace" if $_[1] !~ /\./;
					my ($ns,$key) = split(/\./,$_[1],2);
					File::ExtAttr::delfattr($_[0], $key, { namespace => $ns }) or die "Cannot delfattr('$_[0]','$_[1]') - $!";
				},
			);
			$self->{ssh}->use_library('FS', qw( chown chmod lstat readlink rename rmdir symlink unlink utime ) );
			$self->{ssh}->use_library('Fuse::PerlSSH::RemoteFunctions');

			my $rval;
			eval { $rval = $self->_remote->call("test_connection"); };
			die "Fuse::PerlSSH::FS ssh connection not working!" if $@;
			print STDERR "## _remote: test_connection: ".Dumper($rval) if $self->{debug};
		}else{
			die "Fuse::PerlSSH::FS was not able to log in to host $self->{host} on port $self->{port} with user $self->{user}";
			return undef;
		}

t/004_mounted.t  view on Meta::CPAN

	my $dir = $ENV{PERLSSH_TEST_MOUNTED} .'/test-perlsshfs-'.time();
	print STDERR "Testing in dir '$dir'\n";
	mkdir($dir) or die "Could not make test dir '$dir': $!";

	my $tvf = Test::Virtual::Filesystem->new({ mountdir => $dir });
	$tvf->enable_test_xattr(0);
	$tvf->enable_test_time(1);
	$tvf->enable_test_atime(1);
	$tvf->enable_test_mtime(1);
	$tvf->enable_test_ctime(1);
	$tvf->enable_test_chown(0);
	$tvf->enable_test_permissions(1);
	$tvf->enable_test_special(0);
	$tvf->enable_test_nlink(0);
	$tvf->enable_test_hardlink(1);

	$tvf->runtests;

	## our own breed of xattr tests
	# something in Test::Virtual::Filesystem messes up the xattr functions
	# below tests all fail when run after T::V::F, probably that's why the



( run in 1.228 second using v1.01-cache-2.11-cpan-71847e10f99 )