Skip to content
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
c8448ea
Add report
frhuelsz Mar 31, 2026
d3f21c7
enhance
frhuelsz Mar 31, 2026
3e0377f
is_esp check info
frhuelsz Mar 31, 2026
8a7bce4
Enhance list
frhuelsz Mar 31, 2026
86b862f
Emojis for readability
frhuelsz Mar 31, 2026
479479a
Relax EFP path validation.
frhuelsz Apr 1, 2026
3cf1477
Progress
frhuelsz Apr 1, 2026
2101bbb
Tests & coverage
frhuelsz Apr 1, 2026
9c26a22
Update status
frhuelsz Apr 1, 2026
32bd0b3
Address issues with adopted partitions
frhuelsz Apr 1, 2026
e5c24c8
update report
frhuelsz Apr 1, 2026
a00a03e
Apply suggestions from code review
frhuelsz Apr 2, 2026
89fa5f3
review rename
frhuelsz Apr 2, 2026
48b513d
Update schema
frhuelsz Apr 2, 2026
d0f2aaa
New HC field for ESP Boot Path
frhuelsz Apr 2, 2026
1ffa666
is_esp
frhuelsz Apr 2, 2026
cf97357
Finish impl of new HC field.
frhuelsz Apr 2, 2026
a1e8f09
Delete unused fn
frhuelsz Apr 2, 2026
ac6eee3
Remove unused
frhuelsz Apr 3, 2026
88198ac
Fix indoc usages
frhuelsz Apr 3, 2026
ce842b6
Fix more constant usages
frhuelsz Apr 3, 2026
8c09b78
Update report
frhuelsz Apr 3, 2026
fb3ae1c
Use serde from/into instead
frhuelsz Apr 3, 2026
9a7c1bb
clippy
frhuelsz Apr 3, 2026
9e0a4f6
Error for non-absolute paths
frhuelsz Apr 3, 2026
6b32322
remove unused
frhuelsz Apr 3, 2026
e90e57d
Update comment
frhuelsz Apr 3, 2026
2fe228e
Initialize on tests
frhuelsz Apr 4, 2026
a5a7530
initialize on offline init
frhuelsz Apr 4, 2026
c7032e4
Address concerns in derived HC
frhuelsz Apr 4, 2026
aa1607f
Test and fixes
frhuelsz Apr 4, 2026
f8e35fe
Merge branch 'main' into user/frhuelsz/efi-path-enginecontext
frhuelsz Apr 6, 2026
ae1b7b5
Item 6 & 7
frhuelsz Apr 6, 2026
41cb1c2
Item 23
frhuelsz Apr 6, 2026
ca22503
Update doc
frhuelsz Apr 6, 2026
4045160
Update report
frhuelsz Apr 6, 2026
8d034a2
Update light numbers
frhuelsz Apr 6, 2026
31ed4e7
Resolve item 8
frhuelsz Apr 7, 2026
194806b
Resolve item 9
frhuelsz Apr 7, 2026
38115e7
Resolve item 10
frhuelsz Apr 7, 2026
637e444
Resolve item 11
frhuelsz Apr 7, 2026
71e1037
Move ESP_MOUNT_POINT_PATH imports to test modules (items 9, 10)
frhuelsz Apr 7, 2026
14fc6b2
Resolve item 12
frhuelsz Apr 7, 2026
7cca9e2
Resolve item 13
frhuelsz Apr 7, 2026
a375103
Resolve item 14
frhuelsz Apr 7, 2026
018c15c
Resolve item 17
frhuelsz Apr 7, 2026
19fc02d
Resolve item 18
frhuelsz Apr 7, 2026
618df99
Fix build: add ESP_MOUNT_POINT_PATH to functional_test modules, resol…
frhuelsz Apr 7, 2026
db9613f
Copilot fmt permission
frhuelsz Apr 7, 2026
d30c87e
Impl PR API suggestions
frhuelsz Apr 7, 2026
6759987
Update validation
frhuelsz Apr 8, 2026
9e8fb6e
Propagate fixes
frhuelsz Apr 8, 2026
9c7ecf0
Cleanup Errors
frhuelsz Apr 8, 2026
b4aa46b
Validation cleanup
frhuelsz Apr 8, 2026
42b0202
Fixes for UTs
frhuelsz Apr 8, 2026
6367530
Tests passing
frhuelsz Apr 8, 2026
6071f15
UT coverage
frhuelsz Apr 8, 2026
1dc0cc7
grammar
frhuelsz Apr 8, 2026
038d254
fix: require mount_point when override_esp_mount is Override
frhuelsz Apr 8, 2026
a2009e3
docs: regenerate schema and API docs to include overrideEspMount
frhuelsz Apr 8, 2026
c62a1cd
test: add serde round-trip tests for override_esp_mount
frhuelsz Apr 8, 2026
7e433df
fmt
frhuelsz Apr 8, 2026
8218a42
docs: update ESP test doc comments to reflect is_esp-driven selection
frhuelsz Apr 8, 2026
7aa6c6d
cleanup: remove commented-out FileSystemSourceKind enum
frhuelsz Apr 8, 2026
c3576de
test: add test for EspMountPointNotFound when no ESP filesystem exists
frhuelsz Apr 9, 2026
9d42fb4
Merge branch 'user/frhuelsz/efi-path-validation' into user/frhuelsz/e…
frhuelsz Apr 9, 2026
d1ea12a
Build fix
frhuelsz Apr 9, 2026
e30e9da
fix: correct typo and remove redundant word in validation_tests comment
frhuelsz Apr 9, 2026
2d17f78
refactor: simplify esp_filesystem with find + and_then
frhuelsz Apr 9, 2026
dd01dbb
Merge branch 'main' into user/frhuelsz/efi-path-enginecontext
frhuelsz Apr 9, 2026
09a5625
Merge branch 'user/frhuelsz/efi-path-validation' into user/frhuelsz/e…
frhuelsz Apr 9, 2026
dd2c0ff
fix: remove unused fmt::Debug import
frhuelsz Apr 9, 2026
238cdae
Merge branch 'main' into user/frhuelsz/efi-path-validation
frhuelsz Apr 9, 2026
29ebe20
ESP detection in offline initialize
frhuelsz Apr 9, 2026
33442b4
fix: correct stale comment referencing non-existent HostStorageConfig
frhuelsz Apr 9, 2026
fdee7e4
Merge branch 'user/frhuelsz/efi-path-validation' into user/frhuelsz/e…
frhuelsz Apr 9, 2026
8000c74
Update to use new API
frhuelsz Apr 9, 2026
2459e75
Update UTs
frhuelsz Apr 9, 2026
974216e
fmt
frhuelsz Apr 9, 2026
b591521
Fix typo in error
frhuelsz Apr 9, 2026
d0d4ca0
Merge branch 'main' into user/frhuelsz/efi-path-enginecontext
frhuelsz Apr 9, 2026
05dc342
Update .vscode/settings.json
frhuelsz Apr 9, 2026
153298f
Update report
frhuelsz Apr 9, 2026
7686fa0
remove stale data
frhuelsz Apr 9, 2026
388b9d2
fix: provide custom Default for EngineContext with ESP_MOUNT_POINT_PATH
frhuelsz Apr 9, 2026
cf7327a
fix: update hardcoded ESP comment in clean_install.rs
frhuelsz Apr 9, 2026
697e149
refactor: rename relative_esp_efi_path to esp_mount_path in install_i…
frhuelsz Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@
"protobuf.includes": [
"${workspaceFolder}/proto"
],
"chat.tools.terminal.autoApprove": {
"cargo fmt": true
},
Comment thread
frhuelsz marked this conversation as resolved.
Outdated
}
4 changes: 2 additions & 2 deletions crates/trident/src/engine/ab_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use log::{debug, info, warn};

use osutils::{chroot, container};
use trident_api::{
constants::{internal_params::NO_TRANSITION, ESP_MOUNT_POINT_PATH, ROOT_MOUNT_POINT_PATH},
constants::{internal_params::NO_TRANSITION, ROOT_MOUNT_POINT_PATH},
error::{InternalError, ReportError, ServicingError, TridentError, TridentResultExt},
status::{HostStatus, ServicingState, ServicingType},
};
Expand Down Expand Up @@ -154,7 +154,7 @@ pub(crate) fn finalize_update(
})?;

let root_path = container::get_host_relative_path(PathBuf::from(ROOT_MOUNT_POINT_PATH))?;
let esp_path = container::get_host_relative_path(PathBuf::from(ESP_MOUNT_POINT_PATH))?;
let esp_path = container::get_host_relative_path(ctx.esp_mount_path.as_path().into())?;
bootentries::create_and_update_boot_variables(&ctx, &esp_path)?;
// Analogous to how UEFI variables are configured, finalize must start configuring
// UEFI fallback, and a successful commit will finish it.
Expand Down
7 changes: 5 additions & 2 deletions crates/trident/src/engine/boot/grub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use osutils::{
use trident_api::{
config::Selinux,
constants::{
BOOT_MOUNT_POINT_PATH, ESP_EFI_DIRECTORY, ESP_MOUNT_POINT_PATH, GRUB2_CONFIG_FILENAME,
BOOT_MOUNT_POINT_PATH, ESP_EFI_DIRECTORY, GRUB2_CONFIG_FILENAME,
GRUB2_CONFIG_RELATIVE_PATH, ROOT_MOUNT_POINT_PATH, TRIDENT_OVERLAY_LOWER_RELATIVE_PATH,
TRIDENT_OVERLAY_UPPER_RELATIVE_PATH, TRIDENT_OVERLAY_WORK_RELATIVE_PATH,
},
Expand Down Expand Up @@ -81,7 +81,9 @@ pub(super) fn update_configs(ctx: &EngineContext, os_modifier_path: &Path) -> Re
}

// Update GRUB config on the ESP
let bootentry_config_path = Path::new(ESP_MOUNT_POINT_PATH)
let bootentry_config_path = ctx
.esp_mount_path
.as_path()
.join(ESP_EFI_DIRECTORY)
.join(super::get_update_esp_dir_name(ctx).context("Failed to get update install ID")?)
.join(GRUB2_CONFIG_FILENAME);
Expand Down Expand Up @@ -285,6 +287,7 @@ pub(crate) mod functional_test {
self, AbUpdate, AbVolumePair, Disk, FileSystem, FileSystemSource, HostConfiguration,
MountOptions, MountPoint, Partition, PartitionType, RaidLevel, SoftwareRaidArray,
},
constants::ESP_MOUNT_POINT_PATH,
status::ServicingType,
};

Expand Down
13 changes: 8 additions & 5 deletions crates/trident/src/engine/bootentries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use osutils::{

use trident_api::{
config::RaidLevel,
constants::{self, internal_params::VIRTDEPLOY_BOOT_ORDER_WORKAROUND, ESP_MOUNT_POINT_PATH},
constants::{self, internal_params::VIRTDEPLOY_BOOT_ORDER_WORKAROUND},
error::{InternalError, ReportError, ServicingError, TridentError, TridentResultExt},
status::{AbVolumeSelection, ServicingType},
BlockDeviceId,
Expand Down Expand Up @@ -286,7 +286,7 @@ fn create_boot_entries_for_rebuilt_esp_partitions(
ctx,
esp_device.clone(),
entry_label.clone(),
Path::new(ESP_MOUNT_POINT_PATH),
ctx.esp_mount_path.as_path(),
bootloader_path,
true,
)
Expand Down Expand Up @@ -1024,9 +1024,12 @@ mod functional_test {
testutils::repart::{OS_DISK_DEVICE_PATH, TEST_DISK_DEVICE_PATH},
};
use pytest_gen::functional_test;
use trident_api::config::{
self, Disk, HostConfiguration, ImageSha384, MountOptions, MountPoint, OsImage, Partition,
PartitionSize, PartitionType,
use trident_api::{
config::{
self, Disk, HostConfiguration, ImageSha384, MountOptions, MountPoint, OsImage,
Partition, PartitionSize, PartitionType,
},
constants::ESP_MOUNT_POINT_PATH,
};

use crate::engine::{storage::partitioning, EngineContext};
Expand Down
7 changes: 4 additions & 3 deletions crates/trident/src/engine/clean_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use trident_api::{
internal_params::{
DISABLE_MEDIA_EJECTION, ENABLE_UKI_SUPPORT, NO_TRANSITION, RAW_COSI_STORAGE,
},
ESP_MOUNT_POINT_PATH, ROOT_MOUNT_POINT_PATH, UPDATE_ROOT_PATH,
ROOT_MOUNT_POINT_PATH, UPDATE_ROOT_PATH,
},
error::{
InitializationError, InternalError, InvalidInputError, ReportError, ServicingError,
Expand Down Expand Up @@ -214,7 +214,8 @@ fn stage_clean_install(
&ctx.partition_paths,
AbVolumeSelection::VolumeA,
)?;
ctx.install_index = install_index::next_install_index(newroot_mount.path())?;
ctx.install_index =
install_index::next_install_index(newroot_mount.path(), ctx.esp_mount_path.as_path())?;

engine::provision(subsystems, &ctx, newroot_mount.path())?;

Expand Down Expand Up @@ -305,7 +306,7 @@ pub(crate) fn finalize_clean_install(
};

// On clean install, need to verify that AZLA entry exists in /mnt/newroot/boot/efi
Comment thread
frhuelsz marked this conversation as resolved.
Outdated
let esp_path = join_relative(new_root.path(), ESP_MOUNT_POINT_PATH);
let esp_path = join_relative(new_root.path(), ctx.esp_mount_path.as_path());

if !ctx.spec.internal_params.get_flag(RAW_COSI_STORAGE) {
bootentries::create_and_update_boot_variables(&ctx, &esp_path)?;
Expand Down
15 changes: 2 additions & 13 deletions crates/trident/src/engine/context/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use derive_more::From;
use sysdefs::filesystems::{KernelFilesystemType, NodevFilesystemType, RealFilesystemType};
use trident_api::{
config::{FileSystem, FileSystemSource, MountPoint, NewFileSystemType},
constants::{ESP_MOUNT_POINT_PATH, MOUNT_OPTION_READ_ONLY, ROOT_MOUNT_POINT_PATH},
constants::{MOUNT_OPTION_READ_ONLY, ROOT_MOUNT_POINT_PATH},
error::{InternalError, ReportError, TridentError, TridentResultExt},
BlockDeviceId,
};
Expand Down Expand Up @@ -171,13 +171,6 @@ impl FileSystemData {
.is_some_and(|mpp| mpp == Path::new(ROOT_MOUNT_POINT_PATH))
}

/// Returns whether the filesystem is the EFI System Partition (ESP), as
/// determined by its mount point path.
pub fn is_esp(&self) -> bool {
self.mount_point_path()
.is_some_and(|mpp| mpp == Path::new(ESP_MOUNT_POINT_PATH))
}

/// Returns the path of the mount point, if it exists.
pub fn mount_point_path(&self) -> Option<&Path> {
match self {
Expand Down Expand Up @@ -254,10 +247,6 @@ impl FileSystemDataImage {
self.mount_point.options.contains(MOUNT_OPTION_READ_ONLY)
}

pub fn is_esp(&self) -> bool {
self.mount_point_path() == Path::new(ESP_MOUNT_POINT_PATH)
}

pub fn is_root(&self) -> bool {
self.mount_point_path() == Path::new(ROOT_MOUNT_POINT_PATH)
}
Expand Down Expand Up @@ -354,7 +343,7 @@ impl EngineContext {
pub fn esp_filesystem(&self) -> Option<FileSystemDataImage> {
self.filesystems()
.filter_map(|fs| fs.as_image().cloned())
.find(|img_fs| img_fs.mount_point.path == Path::new(ESP_MOUNT_POINT_PATH))
.find(|img_fs| img_fs.mount_point.path == self.esp_mount_path.as_path())
}
}

Expand Down
14 changes: 14 additions & 0 deletions crates/trident/src/engine/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ pub struct EngineContext {

/// Whether the image will use a UKI or not.
pub is_uki: Option<bool>,

/// The mount path of the ESP partition.
pub esp_mount_path: PathBuf,
}
Comment thread
frhuelsz marked this conversation as resolved.

impl EngineContext {
Expand All @@ -108,6 +111,16 @@ impl EngineContext {
pub fn new(params: EngineContextParams) -> Result<Self, TridentError> {
let graph = super::build_storage_graph(&params.spec.storage)?;

// Get the ESP mount path from the storage graph. This should be
// guaranteed to exist in validated Host configurations.
let esp_mount_path =
graph
.esp_mount_path()
.ok_or(TridentError::new(InternalError::Internal(
"Storage graph does not contain an ESP mount path, the Host Configuration was not validated properly.",
)))?
.to_path_buf();

Ok(Self {
spec: params.spec,
spec_old: params.spec_old,
Expand All @@ -120,6 +133,7 @@ impl EngineContext {
storage_graph: graph,
filesystems: Vec::new(),
is_uki: params.is_uki,
esp_mount_path,
})
}

Expand Down
86 changes: 60 additions & 26 deletions crates/trident/src/engine/install_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,31 @@ use std::path::Path;

use log::{debug, trace};

use osutils::path;
use trident_api::{
constants::{ESP_EFI_DIRECTORY, ESP_RELATIVE_MOUNT_POINT_PATH},
constants::ESP_EFI_DIRECTORY,
error::{ReportError, TridentError, TridentResultExt, UnsupportedConfigurationError},
};

use crate::engine::boot;

/// Returns the next available install index for the current install.
pub fn next_install_index(mount_point: &Path) -> Result<usize, TridentError> {
let esp_efi_path = mount_point
.join(ESP_RELATIVE_MOUNT_POINT_PATH)
.join(ESP_EFI_DIRECTORY);
///
/// The install index is determined by looking at the existing ESP directory
/// names in the ESP EFI path and finding the first available index that doesn't
/// have any corresponding ESP directory names. This ensures that the new
/// install will not overwrite any existing installs, even if some of them have
/// missing ESP directories.
///
/// The function takes the root mount point and the ESP mount path (with or
/// without leading `/`) as parameters to construct the full path to the ESP EFI
/// directory where the install directories are located.
pub fn next_install_index(
root_mount_point: &Path,
esp_mount_path: &Path,
) -> Result<usize, TridentError> {
let esp_efi_path =
path::join_relative(root_mount_point, esp_mount_path).join(ESP_EFI_DIRECTORY);

debug!(
"Looking for next available install index in '{}'",
Expand Down Expand Up @@ -55,41 +68,48 @@ mod tests {

use tempfile::TempDir;

use trident_api::error::ErrorKind;
use trident_api::{constants::ESP_MOUNT_POINT_PATH, error::ErrorKind};

use crate::engine::boot::make_esp_dir_name_candidates;

// Helper that constructs the ESP EFI path, creates the directories, and returns the path.
fn setup_esp_efi_path(mount_point: &Path) -> PathBuf {
let esp_efi_path = mount_point
.join(ESP_RELATIVE_MOUNT_POINT_PATH)
.join(ESP_EFI_DIRECTORY);
// Helper that constructs the ESP EFI path, creates the directories, and returns
// (full_esp_efi_path, esp_mount_path). The esp_mount_path is what next_install_index expects.
fn setup_esp_efi_path(mount_point: &Path) -> (PathBuf, PathBuf) {
let esp_mount_path = PathBuf::from(ESP_MOUNT_POINT_PATH);
let esp_efi_path =
path::join_relative(mount_point, &esp_mount_path).join(ESP_EFI_DIRECTORY);
fs::create_dir_all(&esp_efi_path).unwrap();
esp_efi_path
(esp_efi_path, esp_mount_path)
}

#[test]
fn test_install_index_variants() {
// Test case #0: No existing install directories.
let test_dir = TempDir::new().unwrap();
let esp_efi_path = setup_esp_efi_path(test_dir.path());
assert_eq!(next_install_index(test_dir.path()).unwrap(), 0);
let (esp_efi_path, relative_esp_efi_path) = setup_esp_efi_path(test_dir.path());
assert_eq!(
next_install_index(test_dir.path(), &relative_esp_efi_path).unwrap(),
0
Comment thread
frhuelsz marked this conversation as resolved.
Outdated
);
assert_eq!(
find_first_available_install_index(&esp_efi_path).unwrap(),
0
);

// Test case #1: Install directories 0-9 exist.
let test_dir = TempDir::new().unwrap();
let esp_efi_path = setup_esp_efi_path(test_dir.path());
let (esp_efi_path, relative_esp_efi_path) = setup_esp_efi_path(test_dir.path());
make_esp_dir_name_candidates()
.take(10)
.for_each(|(_, dir_names)| {
for dir_name in dir_names {
fs::create_dir(esp_efi_path.join(dir_name)).unwrap();
}
});
assert_eq!(next_install_index(test_dir.path()).unwrap(), 10);
assert_eq!(
next_install_index(test_dir.path(), &relative_esp_efi_path).unwrap(),
10
);
assert_eq!(
find_first_available_install_index(&esp_efi_path).unwrap(),
10
Expand All @@ -98,13 +118,16 @@ mod tests {
// Test case #2: Install directories 0-9 exist. Func will skip unavailable indices, even
// when only the A volume IDs are present.
let test_dir = TempDir::new().unwrap();
let esp_efi_path = setup_esp_efi_path(test_dir.path());
let (esp_efi_path, relative_esp_efi_path) = setup_esp_efi_path(test_dir.path());
make_esp_dir_name_candidates()
.take(10)
.for_each(|(_, dir_names)| {
fs::create_dir(esp_efi_path.join(&dir_names[0])).unwrap();
});
assert_eq!(next_install_index(test_dir.path()).unwrap(), 10);
assert_eq!(
next_install_index(test_dir.path(), &relative_esp_efi_path).unwrap(),
10
);
assert_eq!(
find_first_available_install_index(&esp_efi_path).unwrap(),
10
Expand All @@ -113,13 +136,16 @@ mod tests {
// Test case #3: Install directories 0-9 exist. Func will skip unavailable indices, even
// when only the A volume IDs are present.
let test_dir = TempDir::new().unwrap();
let esp_efi_path = setup_esp_efi_path(test_dir.path());
let (esp_efi_path, relative_esp_efi_path) = setup_esp_efi_path(test_dir.path());
make_esp_dir_name_candidates()
.take(10)
.for_each(|(_, dir_names)| {
fs::create_dir(esp_efi_path.join(&dir_names[1])).unwrap();
});
assert_eq!(next_install_index(test_dir.path()).unwrap(), 10);
assert_eq!(
next_install_index(test_dir.path(), &relative_esp_efi_path).unwrap(),
10
);
assert_eq!(
find_first_available_install_index(&esp_efi_path).unwrap(),
10
Expand All @@ -128,22 +154,25 @@ mod tests {
// Test case #4: Install directories 0-9 exist. Func will skip unavailable indices, even
// when only one ID is present per install.
let test_dir = TempDir::new().unwrap();
let esp_efi_path = setup_esp_efi_path(test_dir.path());
let (esp_efi_path, relative_esp_efi_path) = setup_esp_efi_path(test_dir.path());
let mut volume_selector = (0..=1).cycle();
make_esp_dir_name_candidates()
.take(10)
.for_each(|(_, dir_names)| {
fs::create_dir(esp_efi_path.join(&dir_names[volume_selector.next().unwrap()]))
.unwrap();
});
assert_eq!(next_install_index(test_dir.path()).unwrap(), 10);
assert_eq!(
next_install_index(test_dir.path(), &relative_esp_efi_path).unwrap(),
10
);
assert_eq!(
find_first_available_install_index(&esp_efi_path).unwrap(),
10
);

let test_dir = TempDir::new().unwrap();
let esp_efi_path = setup_esp_efi_path(test_dir.path());
let (esp_efi_path, relative_esp_efi_path) = setup_esp_efi_path(test_dir.path());
let mut volume_selector = (0..=1).cycle();
volume_selector.next(); // Advance to start with B
make_esp_dir_name_candidates()
Expand All @@ -152,7 +181,10 @@ mod tests {
fs::create_dir(esp_efi_path.join(&dir_names[volume_selector.next().unwrap()]))
.unwrap();
});
assert_eq!(next_install_index(test_dir.path()).unwrap(), 10);
assert_eq!(
next_install_index(test_dir.path(), &relative_esp_efi_path).unwrap(),
10
);
assert_eq!(
find_first_available_install_index(&esp_efi_path).unwrap(),
10
Expand All @@ -162,7 +194,7 @@ mod tests {
#[test]
fn test_no_available_install_index() {
let test_dir = tempfile::TempDir::new().unwrap();
let esp_efi_path = setup_esp_efi_path(test_dir.path());
let (esp_efi_path, relative_esp_efi_path) = setup_esp_efi_path(test_dir.path());

// Exhaust all possible indices (up to 1000)
crate::engine::boot::make_esp_dir_name_candidates()
Expand All @@ -183,7 +215,9 @@ mod tests {
);

assert_eq!(
next_install_index(test_dir.path()).unwrap_err().kind(),
next_install_index(test_dir.path(), &relative_esp_efi_path)
.unwrap_err()
.kind(),
&ErrorKind::UnsupportedConfiguration(
UnsupportedConfigurationError::NoAvailableInstallIndex
)
Expand Down
Loading
Loading