public function generate_download_object_list($do_file_checks = true) { $download_xml_file = $this->test_profile->get_file_download_spec(); if ($download_xml_file != null) { $xml_parser = new pts_test_downloads_nye_XmlReader($download_xml_file); $package_url = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/URL'); $package_md5 = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/MD5'); $package_sha256 = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/SHA256'); $package_filename = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/FileName'); $package_filesize = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/FileSize'); $package_platform = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/PlatformSpecific'); $package_architecture = $xml_parser->getXMLArrayValues('PhoronixTestSuite/Downloads/Package/ArchitectureSpecific'); foreach (array_keys($package_url) as $i) { if (!empty($package_platform[$i]) && $do_file_checks) { $platforms = pts_strings::comma_explode($package_platform[$i]); if (!in_array(phodevi::operating_system(), $platforms) && !(phodevi::is_bsd() && in_array('Linux', $platforms) && (pts_client::executable_in_path('kldstat') && strpos(shell_exec('kldstat -n linux 2>&1'), 'linux.ko') != false))) { // This download does not match the operating system continue; } } if (!empty($package_architecture[$i]) && $do_file_checks) { $architectures = pts_strings::comma_explode($package_architecture[$i]); if (phodevi::cpu_arch_compatible($architectures) == false) { // This download does not match the CPU architecture continue; } } $this->test_files[] = new pts_test_file_download($package_url[$i], $package_filename[$i], $package_filesize[$i], $package_md5[$i], $package_sha256[$i], $package_platform[$i], $package_architecture[$i]); } } }
public function is_test_architecture_supported() { // Check if the system's architecture is supported by a test $archs = $this->get_supported_architectures(); return !empty($archs) ? phodevi::cpu_arch_compatible($archs) : true; }
public function is_test_architecture_supported() { // Check if the system's architecture is supported by a test $supported = true; $archs = $this->get_supported_architectures(); if (!empty($archs)) { $supported = phodevi::cpu_arch_compatible($archs); } return $supported; }