Skip to content

Commit

Permalink
[Tools] Package manager check and CA cert check (#6189)
Browse files Browse the repository at this point in the history
Checking package managers like apt-get, yum, rpm, dpkg. 
apt-get installs the default dependencies like ca-certificates. When apt-get is not present, an additional check is also made.
  • Loading branch information
ggjjj authored Mar 12, 2022
1 parent 99ae1e3 commit 5f6d339
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions platform-validation/scripts/aziot-compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,41 @@ check_storage_space() {

}

check_package_manager() {
not_found=0
package_managers="apt-get dnf yum dpkg rpm"
for package in $package_managers; do
{
res="$(need_cmd $package)"
if [ $? -eq 0 ] ; then
not_found=0
wrap_debug "Current target platform supports $package package manager"
wrap_pass "check_package_manager"
if [ $package = "rpm" ] || [ $package = "dpkg" ]; then
check_ca_cert
fi
break;
else
not_found=1
wrap_debug "Current target platform does not support $package package manager"
fi
}
done
if [ "$not_found" -eq 1 ]; then
wrap_warn "check_package_manager"
wrap_warning "IoT Edge supports the following package types [*deb, *rpm] and following package managers [apt-get].We have identified that this device does not have support for the supported package type. Please head to aka.ms/iotedge for instructions on how to build the iotedge binaries from source"
check_ca_cert
fi
}

check_ca_cert() {
if [ ! -d "/etc/ca-certificates" ]; then
wrap_warn "Install ca-certificates package"
else
wrap_pass "check_ca_cert"
fi
}

#TODO : Update these numbers after Automated Run. The goal is that for every release, we would update these numbers
armv7l_iotedge_binaries_size=36.68
armv7l_iotedge_binaries_avg_memory=35.51
Expand All @@ -616,6 +651,7 @@ aarch64_iotedge_container_size=322.6
aarch64_iotedge_container_memory=154.53
iot_edge_size_buffer=50
iot_edge_memory_buffer=50

aziotedge_check() {

# Todo : As we add new versions, these checks will need to be changed. Keep a common check for now
Expand Down Expand Up @@ -662,6 +698,7 @@ aziotedge_check() {
fi

check_shared_library_dependency
check_package_manager

eval binary_size='$'"$(echo "$ARCH"_iotedge_binaries_size)"
eval container_size='$'"$(echo "$ARCH"_iotedge_container_size)"
Expand Down

0 comments on commit 5f6d339

Please sign in to comment.