forked from youki-dev/youki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the feature test and turn on in CI (youki-dev#2060)
* reworked the justfile to be explicit with path Signed-off-by: yihuaf <[email protected]> * fix the feature tests Signed-off-by: yihuaf <[email protected]> * add the musl test Signed-off-by: yihuaf <[email protected]> * moving all stub into a single dir Signed-off-by: yihuaf <[email protected]> --------- Signed-off-by: yihuaf <[email protected]>
- Loading branch information
Showing
24 changed files
with
234 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use crate::common::{AnyCgroupManager, CgroupManager}; | ||
|
||
#[derive(thiserror::Error, Debug)] | ||
pub enum SystemdManagerError { | ||
#[error("systemd cgroup feature is required, but was not enabled during compile time")] | ||
NotEnabled, | ||
} | ||
|
||
pub struct Manager {} | ||
|
||
impl Manager { | ||
pub fn any(self) -> AnyCgroupManager { | ||
AnyCgroupManager::Systemd(self) | ||
} | ||
} | ||
|
||
impl CgroupManager for Manager { | ||
type Error = SystemdManagerError; | ||
|
||
fn add_task(&self, _pid: nix::unistd::Pid) -> Result<(), Self::Error> { | ||
Err(SystemdManagerError::NotEnabled) | ||
} | ||
|
||
fn apply(&self, _controller_opt: &crate::common::ControllerOpt) -> Result<(), Self::Error> { | ||
Err(SystemdManagerError::NotEnabled) | ||
} | ||
|
||
fn remove(&self) -> Result<(), Self::Error> { | ||
Err(SystemdManagerError::NotEnabled) | ||
} | ||
|
||
fn freeze(&self, _state: crate::common::FreezerState) -> Result<(), Self::Error> { | ||
Err(SystemdManagerError::NotEnabled) | ||
} | ||
|
||
fn stats(&self) -> Result<crate::stats::Stats, Self::Error> { | ||
Err(SystemdManagerError::NotEnabled) | ||
} | ||
|
||
fn get_all_pids(&self) -> Result<Vec<nix::unistd::Pid>, Self::Error> { | ||
Err(SystemdManagerError::NotEnabled) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod manager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use crate::common::{AnyCgroupManager, CgroupManager}; | ||
|
||
#[derive(thiserror::Error, Debug)] | ||
pub enum V1ManagerError { | ||
#[error("v1 cgroup feature is required, but was not enabled during compile time")] | ||
NotEnabled, | ||
} | ||
|
||
pub struct Manager {} | ||
|
||
impl Manager { | ||
pub fn any(self) -> AnyCgroupManager { | ||
crate::common::AnyCgroupManager::V1(self) | ||
} | ||
} | ||
|
||
impl CgroupManager for Manager { | ||
type Error = V1ManagerError; | ||
|
||
fn add_task(&self, _pid: nix::unistd::Pid) -> Result<(), Self::Error> { | ||
Err(V1ManagerError::NotEnabled) | ||
} | ||
|
||
fn apply(&self, _controller_opt: &crate::common::ControllerOpt) -> Result<(), Self::Error> { | ||
Err(V1ManagerError::NotEnabled) | ||
} | ||
|
||
fn remove(&self) -> Result<(), Self::Error> { | ||
Err(V1ManagerError::NotEnabled) | ||
} | ||
|
||
fn freeze(&self, _state: crate::common::FreezerState) -> Result<(), Self::Error> { | ||
Err(V1ManagerError::NotEnabled) | ||
} | ||
|
||
fn stats(&self) -> Result<crate::stats::Stats, Self::Error> { | ||
Err(V1ManagerError::NotEnabled) | ||
} | ||
|
||
fn get_all_pids(&self) -> Result<Vec<nix::unistd::Pid>, Self::Error> { | ||
Err(V1ManagerError::NotEnabled) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod manager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use crate::common::{AnyCgroupManager, CgroupManager}; | ||
|
||
#[derive(thiserror::Error, Debug)] | ||
pub enum V2ManagerError { | ||
#[error("v2 cgroup feature is required, but was not enabled during compile time")] | ||
NotEnabled, | ||
} | ||
|
||
pub struct Manager {} | ||
|
||
impl Manager { | ||
pub fn any(self) -> AnyCgroupManager { | ||
crate::common::AnyCgroupManager::V2(self) | ||
} | ||
} | ||
|
||
impl CgroupManager for Manager { | ||
type Error = V2ManagerError; | ||
|
||
fn add_task(&self, _pid: nix::unistd::Pid) -> Result<(), Self::Error> { | ||
Err(V2ManagerError::NotEnabled) | ||
} | ||
|
||
fn apply(&self, _controller_opt: &crate::common::ControllerOpt) -> Result<(), Self::Error> { | ||
Err(V2ManagerError::NotEnabled) | ||
} | ||
|
||
fn remove(&self) -> Result<(), Self::Error> { | ||
Err(V2ManagerError::NotEnabled) | ||
} | ||
|
||
fn freeze(&self, _state: crate::common::FreezerState) -> Result<(), Self::Error> { | ||
Err(V2ManagerError::NotEnabled) | ||
} | ||
|
||
fn stats(&self) -> Result<crate::stats::Stats, Self::Error> { | ||
Err(V2ManagerError::NotEnabled) | ||
} | ||
|
||
fn get_all_pids(&self) -> Result<Vec<nix::unistd::Pid>, Self::Error> { | ||
Err(V2ManagerError::NotEnabled) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod manager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.