|
0 |
Index: rust-nix-0.26.1/test/sys/test_socket.rs
|
|
1 |
===================================================================
|
|
2 |
--- rust-nix-0.26.1.orig/test/sys/test_socket.rs
|
|
3 |
+++ rust-nix-0.26.1/test/sys/test_socket.rs
|
|
4 |
@@ -890,8 +890,14 @@ pub fn test_af_alg_cipher() {
|
|
5 |
SockType::SeqPacket,
|
|
6 |
SockFlag::empty(),
|
|
7 |
None,
|
|
8 |
- )
|
|
9 |
- .expect("socket failed");
|
|
10 |
+ );
|
|
11 |
+ // don't fail the tests on systems that don't support this functionality
|
|
12 |
+ if let Err(e) = sock {
|
|
13 |
+ if e == nix::errno::Errno::EAFNOSUPPORT {
|
|
14 |
+ return;
|
|
15 |
+ }
|
|
16 |
+ }
|
|
17 |
+ let sock = sock.expect("socket failed");
|
|
18 |
|
|
19 |
let sockaddr = AlgAddr::new(alg_type, alg_name);
|
|
20 |
bind(sock, &sockaddr).expect("bind failed");
|
|
21 |
@@ -986,8 +992,14 @@ pub fn test_af_alg_aead() {
|
|
22 |
SockType::SeqPacket,
|
|
23 |
SockFlag::empty(),
|
|
24 |
None,
|
|
25 |
- )
|
|
26 |
- .expect("socket failed");
|
|
27 |
+ );
|
|
28 |
+ // don't fail the tests on systems that don't support this functionality
|
|
29 |
+ if let Err(e) = sock {
|
|
30 |
+ if e == nix::errno::Errno::EAFNOSUPPORT {
|
|
31 |
+ return;
|
|
32 |
+ }
|
|
33 |
+ }
|
|
34 |
+ let sock = sock.expect("socket failed");
|
|
35 |
|
|
36 |
let sockaddr = AlgAddr::new(alg_type, alg_name);
|
|
37 |
bind(sock, &sockaddr).expect("bind failed");
|
|
38 |
@@ -2190,8 +2202,14 @@ pub fn test_vsock() {
|
|
39 |
SockType::Stream,
|
|
40 |
SockFlag::empty(),
|
|
41 |
None,
|
|
42 |
- )
|
|
43 |
- .expect("socket failed");
|
|
44 |
+ );
|
|
45 |
+ // don't fail the tests on systems that don't support this functionality
|
|
46 |
+ if let Err(e) = s1 {
|
|
47 |
+ if e == nix::errno::Errno::EAFNOSUPPORT {
|
|
48 |
+ return;
|
|
49 |
+ }
|
|
50 |
+ }
|
|
51 |
+ let s1 = s1.expect("socket failed");
|
|
52 |
|
|
53 |
// VMADDR_CID_HYPERVISOR is reserved, so we expect an EADDRNOTAVAIL error.
|
|
54 |
let sockaddr_hv = VsockAddr::new(libc::VMADDR_CID_HYPERVISOR, port);
|