
On Fri, Nov 13, 2020 at 05:21:35PM +0800, Luan Shengde wrote:
On Fri, Nov 13, 2020 at 03:57:37PM +0800, Yu Chuan wrote:
[Why] The initial rootfs have the follow two problems: - no dns resolver; - selinux is opened;
Signed-off-by: Yu Chuan <13186087857@163.com> --- tests/iso2rootfs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 4f7843d7f348..05274164f8c1 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -338,6 +338,27 @@ run_qcow2rootfs() ./run "${qcow2_path}" "${ROOTFS_DES_DIR}" }
+ +############ config rootfs ############ +config_dns_resolver() +{ + cat <<-EOF > "${ROOTFS_DES_DIR}/etc/resolv.conf"
if use > will override file "${ROOTFS_DES_DIR}/etc/resolv.conf"
this file only need the content what i gave, so can use '>'. -------- Thanks Yu Chuan
does the file empty? or new? If not, suggest use >>
Thanks, Luan Shengde
+ nameserver 114.114.114.114 + nameserver 8.8.8.8 + EOF +} + +disable_selinux() +{ + sed -i 's/^SELINUX=.*/SELINUX=disabled/g' "${ROOTFS_DES_DIR}/etc/selinux/config" +} + +config_rootfs() +{ + config_dns_resolver + disable_selinux +} + ############ test rootfs ############ get_qemu_efi_fd() { @@ -499,6 +520,8 @@ main() config_qcow2rootfs run_qcow2rootfs
+ config_rootfs + test_rootfs submit_test_job_yaml
-- 2.23.0