diff --git a/common/OpTestUtil.py b/common/OpTestUtil.py index 62157a5a..48e1e2ea 100644 --- a/common/OpTestUtil.py +++ b/common/OpTestUtil.py @@ -2316,7 +2316,10 @@ def get_distro_src(self, package, dest_path, build_option=None, pack_dir=None): elif self.distro_name() == 'sles': host.host_run_command("zypper install -y rpm-build") - s_cmd = f"zypper -n source-install {package};cd /usr/src/packages/SOURCES/;./mkspec;cp {package}.spec ../SPECS/" + if package.startswith("kernel"): + s_cmd = f"zypper -n source-install kernel-source;cd /usr/src/packages/SOURCES/;./mkspec;cp {package}.spec ../SPECS/" + else: + s_cmd = f"zypper -n source-install {package};cd /usr/src/packages/SOURCES/;./mkspec;cp {package}.spec ../SPECS/" if host.host_run_command(s_cmd): spec_path = f"/usr/src/packages/SPECS/{package}.spec"