mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-03 08:37:44 +00:00
proxmox-sys: fix regression tests
This commit is contained in:
parent
21686c99e6
commit
ec3965fdad
@ -110,7 +110,7 @@ pub fn sendmail(
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use crate::tools::email::sendmail;
|
use crate::email::sendmail;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn email_without_recipients() {
|
fn email_without_recipients() {
|
||||||
|
@ -36,7 +36,7 @@ pub fn io_err_other<E: ToString>(e: E) -> io::Error {
|
|||||||
/// # use anyhow::{bail, Error};
|
/// # use anyhow::{bail, Error};
|
||||||
/// use nix::{dir::Dir, fcntl::OFlag, sys::stat::Mode};
|
/// use nix::{dir::Dir, fcntl::OFlag, sys::stat::Mode};
|
||||||
///
|
///
|
||||||
/// use proxmox::sys::error::SysError;
|
/// use proxmox_sys::error::SysError;
|
||||||
///
|
///
|
||||||
/// # fn test() -> Result<(), Error> {
|
/// # fn test() -> Result<(), Error> {
|
||||||
///
|
///
|
||||||
@ -116,7 +116,7 @@ impl SysError for nix::Error {
|
|||||||
/// # use std::os::unix::io::RawFd;
|
/// # use std::os::unix::io::RawFd;
|
||||||
/// # use anyhow::{bail, Error};
|
/// # use anyhow::{bail, Error};
|
||||||
///
|
///
|
||||||
/// use proxmox::sys::error::SysResult;
|
/// use proxmox_sys::error::SysResult;
|
||||||
///
|
///
|
||||||
/// struct MyReader(RawFd);
|
/// struct MyReader(RawFd);
|
||||||
///
|
///
|
||||||
|
@ -37,7 +37,7 @@ pub fn create_dir<P: AsRef<Path>>(path: P, options: CreateOptions) -> Result<(),
|
|||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// # use nix::sys::stat::Mode;
|
/// # use nix::sys::stat::Mode;
|
||||||
/// # use nix::unistd::{Gid, Uid};
|
/// # use nix::unistd::{Gid, Uid};
|
||||||
/// # use proxmox::tools::fs::{create_path, CreateOptions};
|
/// # use proxmox_sys::fs::{create_path, CreateOptions};
|
||||||
/// # fn code() -> Result<(), anyhow::Error> {
|
/// # fn code() -> Result<(), anyhow::Error> {
|
||||||
/// create_path(
|
/// create_path(
|
||||||
/// "/var/lib/mytool/wwwdata",
|
/// "/var/lib/mytool/wwwdata",
|
||||||
@ -160,8 +160,8 @@ fn test_create_path() {
|
|||||||
Some(CreateOptions::new().perm(stat::Mode::from_bits_truncate(0o755))),
|
Some(CreateOptions::new().perm(stat::Mode::from_bits_truncate(0o755))),
|
||||||
Some(
|
Some(
|
||||||
CreateOptions::new()
|
CreateOptions::new()
|
||||||
.owner(Uid::effective())
|
.owner(nix::unistd::Uid::effective())
|
||||||
.group(Gid::effective()),
|
.group(nix::unistd::Gid::effective()),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.expect("expected create_path to work");
|
.expect("expected create_path to work");
|
||||||
|
@ -23,7 +23,7 @@ ioctl_write_ptr_bad!(set_size, libc::TIOCSWINSZ, nix::pty::Winsize);
|
|||||||
///
|
///
|
||||||
/// Example:
|
/// Example:
|
||||||
/// ```
|
/// ```
|
||||||
/// # use proxmox::sys::linux::pty::*;
|
/// # use proxmox_sys::linux::pty::*;
|
||||||
/// # use std::process::Command;
|
/// # use std::process::Command;
|
||||||
/// # use nix::Result;
|
/// # use nix::Result;
|
||||||
/// fn fork() -> Result<u64> {
|
/// fn fork() -> Result<u64> {
|
||||||
|
Loading…
Reference in New Issue
Block a user