summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2020-06-26Add Ipv{4,6}PacketInfo support to ControlMessage for send{m,}msgPerry Lorier
This adds Ipv4PacketInfo and Ipv6PacketInfo to ControlMessage, allowing these to be used with sendmsg/sendmmsg. This change contains the following squashed commits: Add Ipv{4,6}PacketInfo to ControlMessage. Add documentation links to Ipv{4,6}PacketInfo Add changelog entry for Ipv{4,6}PacketInfo Add link to PR in the Changelog. Add extra build environments. Add tests for Ipv{4,6}PacketInfo. Swap #[test] and #[cfg] The CI appears to be running the test, even though it's not cfg'd for that platform. I _think_ this might be due to these being in the wrong order. So lets try swapping them. s/freebsd/netbsd/ for Ipv4PacketInfo netbsd supports in_pktinfo, not freebsd. Fix the cfg for Ipv{4,6}PacketInfo usage. Ah, I see what I did wrong. I had fixed the definitions, but I had the wrong cfg() in the usage. This has the usage match the definitions. Change SOL_IPV6 to IPPROTO_IPV6. FreeBSD doesn't have SOL_IPV6, but does have IPPROTO_IPV6, and the two constants are defined as being equal. So change to use IPPROTO_IPV6. Skip Ipv6PacketInfo test if v6 is not available. If IPv6 is not available, then when we try and bind to ip6-localhost, we'll get a EADDRNOTAVAIL, so skip the test. This should mean that the test will run on any machine that has a v6 loopback address. More architecture cfg() fixes. These all need to be the same, and they were not. Make them them all the same. Attempt III. Fix up mismatched cfg's again. Take IV. Make sure the cfg's that use a enum variant match the enum definition.
2020-06-12Merge #1255bors[bot]
1255: Remove several deprecated constants and functions r=asomers a=asomers * `unistd::daemon` on Apple * `unistd::pipe2` on Apple * `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` on Apple * `sys::event::FilterFlag::NOTE_REAP` on Apple * `sys::ptrace::ptrace` on Android and Linux All have been deprecated for more than two releases and one year. Co-authored-by: Alan Somers <asomers@gmail.com>
2020-06-12Add fchown(2) wrapper.Nate Avers
2020-06-05Respond to review commentsAlan Somers
2020-06-04Remove several deprecated constants and functionsAlan Somers
* `unistd::daemon` on Apple * `unistd::pipe2` on Apple * `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` on Apple * `sys::event::FilterFlag::NOTE_REAP` on Apple * `sys::ptrace::ptrace` on Android and Linux All have been deprecated for more than two releases and one year.
2020-06-04Limit internal termios API to pub(crate)Bryant Mairs
2020-05-31Fix test_ptymaster_drop after PR #1098Alan Somers
This test cannot be compiled under Redox. PR #1098 attempted to disable it for Redox, but actually disabled it everywhere. AFAICT, Cargo has no syntax to conditionally enable a target, except based on features. Instead, use conditional compilation within the test.
2020-05-31Convert the crate to edition 2018Alan Somers
2020-05-26Fix build on OpenBSD caused by erroneous inclusion in allowed OS list for ↵Nick Pelone
sendmmsg() / recvmmsg() in #1208. In #1208, sendmmsg() / recvmmsg() were added, but OpenBSD(who doesn't support these) was included on the list of allowed operating systems for sendmmsg() related things. This broke the build on OpenBSD. For more Rust-world examples, see: https://github.com/rust-lang/libc/commit/6f6297301d49ff67b8ca044d651f36a56950298c
2020-05-17Fix test and remove group & user for redoxXavier L'Heureux
- Make sure all tests pass the CI - Redox does not (yet) have passwd functions, so remove it
2020-05-17Add wait, fdatasync, poll and pause for RedoxXavier L'Heureux
2020-05-17Remove warnings when compiling for RedoxXavier L'Heureux
2020-05-17Remove temporarily the failing tests for RedoxXavier L'Heureux
TODO: Fix them in Relibc
2020-05-17Remove more unsupported functions and make it possible to run testsXavier L'Heureux
2020-05-08Add SO_BINDTODEVICE sockoptJean Pierre Dudey
This is available only on Linux as far I know, [socket(7)](https://linux.die.net/man/7/socket) has some information about the `SO_BINDTODEVICE` sockopt. In simple words it binds a socket to an specific network device (specified as an string like "wlo1", "eth0", etc.), to only process packets from that device. Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2020-05-03Fix an "unused import" warning on FreeBSD in test_scm_credentialsAlan Somers
2020-05-02Merge #1216bors[bot]
1216: Add UnixCredentials support on FreeBSD/DragonFly r=asomers a=myfreeweb This allows working with `SCM_CREDS` messages, which are like `SCM_CREDENTIALS` on Linux, but slightly different (always overwritten by the kernel, contain a bit more info — euid and groups). With this PR, it is possible to write portable code that would use the appropriate message for the platform, but one remaining quirk is that `PassCred` thing still has to be present and `cfg`'d to Linux. Adding the `SCM_CREDS` constant to libc: https://github.com/rust-lang/libc/pull/1740 Co-authored-by: Greg V <greg@unrelenting.technology>
2020-05-02Add UnixCredentials support on FreeBSD/DragonFly (cmsgcred/SCM_CREDS)Greg V
2020-05-02Fix an "unused macro" warning on non-Linux platformsAlan Somers
2020-04-26Support sendmmsg/recvmmsgGleb Pomykalov
2020-04-25Support UDP GSO and GRO on linuxGleb Pomykalov
2020-04-21impl io::{Read,Write} for PtyMasterJosh Stone
`PtyMaster` acts like an owned file descriptor, even closing on `Drop`. Implementing `io::Read` and `io::Write` lets it be used directly in standard I/O operations.
2020-04-19Remove a few more cases of mem::uninitialized in the testsAlan Somers
Somehow I didn't noticed these in PR #1158, probably because they're only built on Linux.
2020-04-01Split read and write OFD lock testsAndre Nathan
2020-03-27i686 -> x86Andre Nathan
2020-03-27Explain why OFD tests are disabled in some archsAndre Nathan
2020-03-27Undo rustfmt reformatingAndre Nathan
2020-03-19One more arch exclusionAndre Nathan
2020-03-19Exclude targets failing on CIAndre Nathan
2020-03-18Don't test on mips; replace unwrap for expectAndre Nathan
2020-03-18Fix type of pad fieldAndre Nathan
2020-03-18Add missing libc::flock fields in mipsAndre Nathan
2020-03-18Try to get tests working on 32 bitsAndre Nathan
2020-03-18Add fcntl tests for OFD locksAndre Nathan
2020-02-29add setfsuid and setfsgid implementation for filesystem checksMarco Conte
2020-02-11Provide clearenv()John Gallagher
2019-12-22Skip test_aio_cancel_all on muslAlan Somers
I suspect that the segfault is due to a stack overflow on musl's signal stack, but I can't reproduce the failure locally. Fixes #1169
2019-12-01ScmCredentials now wraps UnixCredentials instead of libc::ucredAlan Somers
2019-12-01Merge #1157bors[bot]
1157: Fix some race conditions in the integration tests r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2019-12-01Fix some race conditions in the integration testsAlan Somers
2019-12-01Remove the last use of mem::uninitializedAlan Somers
Replace it with mem::zeroed. It isn't perfect, but it's better than it was. Issue #1115
2019-12-01Allow signal injection in ptrace::{syscall, detach}Francisco Giordano
2019-11-21Implement sched::sched_getaffinity()Thibaut Ackermann
sched_getaffinity(2) get a process's CPU affinity mask
2019-11-03Implment linkatJohnnie Birch
This adds the linkat function which is part of POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/linkat.html and widely implmented on Unix-Family platforms. Add back trailing whitespace removed on previous force push
2019-10-28Fix sys::socket::recvfrom for TCP socketsAlan Somers
recvfrom(2) only returns the sender's address for protocols that provide it. Usually, that means it returns the sender's address for datagram sockets but not for stream sockets. Fixes #1144
2019-09-30refactored test casesZhang Miaolei
ignore mkfifoat in OSX and andriod
2019-09-30add mkfifoatZhang Miaolei
2019-09-28Merge #1121 #1130bors[bot]
1121: Fix #1093 r=asomers a=tathanhdinh Hello, This PR fixes the problem discovered in #1093. Thanks for any comment. 1130: unistd: getgrouplist: Rework code to use `reserve_double_buffer_size` r=asomers a=otavio The buffer resize logic can be simplified reusing the `reserve_double_buffer_size` method. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Co-authored-by: Ta Thanh Dinh <tathanhdinh@gmail.com> Co-authored-by: Otavio Salvador <otavio@ossystems.com.br>
2019-09-28Merge #1105bors[bot]
1105: posix_fallocate support r=asomers a=dingxiangfei2009 This PR add [`posix_fallocate`](http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html), which is available on - Linux - FreeBSD - Android - Emscripten - Fuchsia - WASI Here is a question: for some reason, `posix_fallocate` returns `EBADF` instead of `EPIPE` if a FIFO file descriptor is passed in on Linux 4.19.64. In the test `EBADF` is used for now, but I would like to know if such behaviour is expected. Co-authored-by: Ding Xiang Fei <dingxiangfei2009@gmail.com>
2019-09-23fix #1093Ta Thanh Dinh