summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2016-09-08Auto merge of #416 - philippkeller:master, r=posborneHomu
add unistd::getcwd and unistd::mkdir As a (late) followup of [this withdrawn PR](https://github.com/rust-lang/libc/pull/326) I have added getcwd (wrapper around `libc::getcwd`) and mkdir (wrapper around `libc::mkdir`) and added testing. A few notes: - I'm new to rust so I would appreciate some pair of eyes testing the code, plus I'm open for revision of code or general remarks about my coding style - I have run the tests both on OSX as on Linux (Ubuntu) - I've run `clippy` to see if my code is well formatted, however clippy issues many warnings about the project. I think I didn't add any more warnings - the methods in unistd are not documented so I also left out the documentation of `getcwd` and `mkdir`, although I think it'd probably be good to add some documentation, especially some example code how to use the methods - the base idea of `getcwd` is [taken from std](https://github.com/rust-lang/rust/blob/1.9.0/src/libstd/sys/unix/os.rs#L95-L119), should I mention that somewhere?
2016-09-07fixed indentationPhilipp Keller
2016-09-06added documentation for getcwd and mkdir, changed test so that it compares ↵Philipp Keller
against std::env::current_dir
2016-09-06made it running with rust 1.2.0: the code for getcwd is now an exact copy of ↵Philipp Keller
the implementation in std
2016-09-05implemented mkdir, extended getcwd test to include long path namesPhilipp Keller
2016-09-03added test for getcwd, still not complete (needs to check also longer ↵Philipp Keller
directory names, need to be created with mkdir first which doesn't exist yet)
2016-09-02implemented getcwd (returning Result<PathBuf>, reconciling all calls to ↵Philipp Keller
expect into proper try handling), needs testing still
2016-09-01Auto merge of #392 - fiveop:less_ffi, r=@fiveopHomu
Replace ffi module by libc functions in mqueue.rs This is almost finished. I still need to check if I introduced any breaking changes by changing signatures. I would want to record this in the change log, however, for that we still need to merge #391. - [x] update change log - [x] run rustfmt on `src/mqueue.rs`
2016-08-31Replace ffi module by libc functions in mqueue.rsPhilipp Matthias Schaefer
2016-08-31Use libc in poll.rsPhilipp Matthias Schaefer
2016-08-15Get rid of a few warnings during compilation of testsPhilipp Matthias Schaefer
2016-06-13Added lseek to unistdAndrei Oprisan
llseek and lseek64 impl Whence fixed formatting awful typo when refactoring no llseek wrong test name using off64_t got rid of offset Added SeekHole/Data; formatted test; SeekCur/Set/End use libc constants
2016-03-31Auto merge of #332 - kamalmarhubi:fork-enum, r=fiveopHomu
unistd: Redesign the enum returned by fork() This changes the name of the enum returned by `fork()` to `ForkResult`, and changes the `Parent` variant to be struct-like. The result can be matched like use nix::unistd::ForkResult::*; match fork().unwrap() { Parent { child } => { ... } Child => { ... } } using the shorthand matching syntax for struct-like enum variants. This is a breaking change.
2016-03-30unistd: Redesign the enum returned by fork()Kamal Marhubi
This commit changes the name of the enum returned by `fork()` to `ForkResult`, and changes the `Parent` variant to be struct-like. The result can be matched like use nix::unistd::ForkResult::*; match fork().unwrap() { Parent { child } => { ... } Child => { ... } } using the shorthand matching syntax for struct-like enum variants. This is a breaking change.
2016-03-30socket: Respect IPv6 flowinfo and scope_id in InetAddr::from_stdKamal Marhubi
Fixes #329
2016-03-30Use pause(2) in test_wait_signalKamal Marhubi
Replace a busy loop with a call to `pause(2)`.
2016-03-21Use getuid(2) from nix instead of libc in test_mountKamal Marhubi
2016-03-21mount: Do not treat unshare(2) failure as test failureKamal Marhubi
The mount test runner uses unprivileged user namespaces. Previously, failure from `unshare(2)` to create the user namespace would fail the test. This changes that to simply print an error and exit successfully. Refs https://github.com/nix-rust/nix/pull/326
2016-03-10update signalfd to use libc typesAlex Gulyás
2016-03-07Add gettidDave Hylands
2016-02-20Auto merge of #271 - abbradar:mqueue-fixes, r=kamalmarhubiHomu
mqueue: change types to allow more cases Part of https://github.com/nix-rust/nix/pull/270, fixed according to @kamalmarhubi's comments.
2016-02-20mqueue: change types to allow more casesNikolay Amiantov
2016-02-20select: allow infinite timeoutNikolay Amiantov
2016-02-14linux: Add splice(2), tee(2), vmsplice(2)Kamal Marhubi
2016-02-12linux: Add sendfile(2)Kamal Marhubi
2016-01-29Convert MSG_ flags to bitflags! type.Philipp Matthias Schaefer
2016-01-29Add tests for sockopt (SndBuf, RcvBuf, SndBufForce, RcvBufForce)Frank Denis
2016-01-27Bring back mountKamal Marhubi
Fixes https://github.com/carllerche/nix-rust/issues/85
2016-01-27Add test for if_nametoindexKamal Marhubi
2016-01-25Add everything from poll.h.Utkarsh Kukreti
2016-01-18update libc to 0.2.2Mattis Marjak
2016-01-13Use tempdir for temporary files in testsKamal Marhubi
2016-01-13Fix compiler warnings in testsKamal Marhubi
2015-10-28Fix handling of sockaddr_un lengthsGeoffrey Thomas
The returned length of AF_UNIX sockaddrs is significant, and generally does not match the length of the entire structure. For filesystem sockets, this is ignorable because the path is also NUL-terminated, but for unbound sockets (e.g., a socketpair) or abstract-namespace sockets (a Linux extension where the address is an arbitrary bytestring), we need to keep track of the length. Fixes #177. Also add a UnixAddr::new_abstract function and some better handling of abstract-namespace socket addresses to fix #169.
2015-10-20Only run signalfd tests when feature is setCarl Lerche
2015-10-20Scope test by signalfdCarl Lerche
2015-10-07Add sys::select::FdSet::clear.Utkarsh Kukreti
2015-10-06Add support for sendmsg(2), recvmsg(2), and cmsg(3)Geoffrey Thomas
The best specification for control message layout appears to be [RFC 2292, section 4](https://tools.ietf.org/html/rfc2292#section-4), despite this not being a wire protocol. These definitions have also been checked against glibc 2.19 <bits/socket.h> and Linux 4.0 <linux/socket.h>, and tested on Debian 8.1 and FreeBSD 10.2 x86_64. The API differs a bit from the cmsg(3) API for type-safety reasons (and also because the cmsg(3) API is terrible). See test/sys/test_socket.rs for an example. Only supports SCM_RIGHTS at the moment. Fixes #88.
2015-09-28added convenience functions for setting O_NONBLOCK on message queuesMarkus Jais
2015-09-28Revert "Add support for sendmsg(2), recvmsg(2), and cmsg(4)"Carl Lerche
This reverts commit 046af7d1ba82506f9bc48e62ac0584361025fc02.
2015-09-28Add sys::select::FdSet and sys::select::select.Utkarsh Kukreti
2015-09-24Add support for sendmsg(2), recvmsg(2), and cmsg(4)Geoffrey Thomas
The best specification for control message layout appears to be [RFC 2292, section 4](https://tools.ietf.org/html/rfc2292#section-4), despite this not being a wire protocol. These definitions have also been checked against glibc 2.19 <bits/socket.h> and Linux 4.0 <linux/socket.h>, and tested on Debian 8.1 and FreeBSD 10.2 x86_64. The API differs a bit from the cmsg(4) API for type-safety reasons (and also because the cmsg(4) API is terrible). See test/sys/test_socket.rs for an example. Only supports SCM_RIGHTS at the moment. Fixes #88.
2015-09-10Add signalfd supportAlex Gulyás
2015-09-03added support and tests for mq_setattrMarkus Jais
2015-09-03test_stat: Remove st_rdev testGeoffrey Thomas
On FreeBSD, st_rdev seems to be set to a unique value (correlated with, but not identical to, st_ino) per file. Neither the FreeBSD nor Linux man page makes any promises on st_rdev for regular files; useful test coverage of st_rdev would check it on a special file. All tests now pass on FreeBSD.
2015-08-21Merge remote-tracking branch 'posborne/ioctl-rework'Carl Lerche
2015-08-17renamed test methods for mqueue and added mq_unlinkMarkus Jais
2015-08-12ioctl: return result type rather than raw integerPaul Osborne
This change also adds macro usages in the tests. Nothing is asserted but the use of the macros provides a basic compile-time check that is otherwise missing. Signed-off-by: Paul Osborne <osbpau@gmail.com>
2015-08-12conditionally enable ioctl test for linuxCorey Richardson
2015-08-12Fix testsCorey Richardson