Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 0 additions & 11 deletions scripts/fetch_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,12 @@ fetch_raw_ubuntu_image() {
convert_image "$OS_IMAGE_NAME" "$OS_RAW_IMAGE_NAME"
}

fetch_clear_image() {
OS_VERSION="$1"
OS_IMAGE_NAME="clear-$OS_VERSION-cloudguest.img"
OS_IMAGE_BASE="https://cdn.download.clearlinux.org/releases/$OS_VERSION/clear"
OS_IMAGE_URL="$OS_IMAGE_BASE/$OS_IMAGE_NAME.xz"
fetch_image "$OS_IMAGE_NAME" "$OS_IMAGE_URL"
xz -d "$OS_IMAGE_NAME.xz"
}

aarch64_fetch_disk_images() {
fetch_raw_ubuntu_image "focal" "arm64" "current"
fetch_raw_ubuntu_image "jammy" "arm64" "current"
}

x86_64_fetch_disk_images() {
fetch_clear_image "31310"

fetch_raw_ubuntu_image "focal" "amd64" "current"
fetch_raw_ubuntu_image "jammy" "amd64" "current"
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ make_test_disks "$WORKLOADS_DIR"

CLEAR_OS_VERSION="28660"
CLEAR_OS_IMAGE_XZ_NAME="clear-$CLEAR_OS_VERSION-kvm.img.xz"
CLEAR_OS_IMAGE_XZ_URL="https://download.clearlinux.org/releases/$CLEAR_OS_VERSION/clear/$CLEAR_OS_IMAGE_XZ_NAME"
CLEAR_OS_IMAGE_XZ_URL="https://ch-images.azureedge.net/$CLEAR_OS_IMAGE_XZ_NAME"
CLEAR_OS_IMAGE_XZ="$WORKLOADS_DIR/$CLEAR_OS_IMAGE_XZ_NAME"
if [ ! -f "$CLEAR_OS_IMAGE_XZ" ]; then
pushd $WORKLOADS_DIR
Expand Down
65 changes: 0 additions & 65 deletions src/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,59 +52,6 @@ mod tests {
fn prepare(&self, tmp_dir: &TempDir, network: &GuestNetworkConfig) -> String;
}

struct ClearCloudInit {}
impl CloudInit for ClearCloudInit {
fn prepare(&self, tmp_dir: &TempDir, network: &GuestNetworkConfig) -> String {
let cloudinit_file_path =
String::from(tmp_dir.path().join("cloudinit").to_str().unwrap());
let cloud_init_directory = tmp_dir
.path()
.join("cloud-init")
.join("clear")
.join("openstack");
fs::create_dir_all(cloud_init_directory.join("latest"))
.expect("Expect creating cloud-init directory to succeed");
let source_file_dir = std::env::current_dir()
.unwrap()
.join("resources")
.join("cloud-init")
.join("clear")
.join("openstack")
.join("latest");
fs::copy(
source_file_dir.join("meta_data.json"),
cloud_init_directory.join("latest").join("meta_data.json"),
)
.expect("Expect copying cloud-init meta_data.json to succeed");
let mut user_data_string = String::new();
fs::File::open(source_file_dir.join("user_data"))
.unwrap()
.read_to_string(&mut user_data_string)
.expect("Expected reading user_data file in to succeed");
user_data_string = user_data_string.replace("192.168.2.1", &network.host_ip);
user_data_string = user_data_string.replace("192.168.2.2", &network.guest_ip);

user_data_string = user_data_string.replace("12:34:56:78:90:ab", &network.guest_mac);
fs::File::create(cloud_init_directory.join("latest").join("user_data"))
.unwrap()
.write_all(user_data_string.as_bytes())
.expect("Expected writing out user_data to succeed");
std::process::Command::new("mkdosfs")
.args(["-n", "config-2"])
.args(["-C", cloudinit_file_path.as_str()])
.arg("8192")
.output()
.expect("Expect creating disk image to succeed");
std::process::Command::new("mcopy")
.arg("-o")
.args(["-i", cloudinit_file_path.as_str()])
.args(["-s", cloud_init_directory.to_str().unwrap(), "::"])
.output()
.expect("Expect copying files to disk image to succeed");
cloudinit_file_path
}
}

struct UbuntuCloudInit {}
impl CloudInit for UbuntuCloudInit {
fn prepare(&self, tmp_dir: &TempDir, network: &GuestNetworkConfig) -> String {
Expand Down Expand Up @@ -627,7 +574,6 @@ mod tests {

const FOCAL_IMAGE_NAME: &str = "focal-server-cloudimg-amd64-raw.img";
const JAMMY_IMAGE_NAME: &str = "jammy-server-cloudimg-amd64-raw.img";
const CLEAR_IMAGE_NAME: &str = "clear-31310-cloudguest.img";

#[test]
fn test_boot_qemu_focal() {
Expand All @@ -639,11 +585,6 @@ mod tests {
test_boot(JAMMY_IMAGE_NAME, &UbuntuCloudInit {}, spawn_qemu)
}

#[test]
fn test_boot_qemu_clear() {
test_boot(CLEAR_IMAGE_NAME, &ClearCloudInit {}, spawn_qemu)
}

#[test]
#[cfg(not(feature = "coreboot"))]
fn test_boot_ch_focal() {
Expand All @@ -655,12 +596,6 @@ mod tests {
fn test_boot_ch_jammy() {
test_boot(JAMMY_IMAGE_NAME, &UbuntuCloudInit {}, spawn_ch)
}

#[test]
#[cfg(not(feature = "coreboot"))]
fn test_boot_ch_clear() {
test_boot(CLEAR_IMAGE_NAME, &ClearCloudInit {}, spawn_ch)
}
}
}

Expand Down