initialization
authorJunWang <junbill.wang@samsung.com>
Fri, 12 Jun 2015 01:19:53 +0000 (09:19 +0800)
committerJunWang <junbill.wang@samsung.com>
Fri, 12 Jun 2015 01:19:53 +0000 (09:19 +0800)
292 files changed:
Makefile [new file with mode: 0644]
README.md [new file with mode: 0644]
cases/create/func_cases/mic_cr_auto_fs.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_auto_loop.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_auto_qcow.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_auto_raw.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_auto_raw_gpt.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_fs_inc-src_cache-dir_arch_logfile_armv7l.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_fs_inc-src_cp-knl_cache-dir_ia32.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_fs_install-pkgs_ia32.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_loop_check-pkgs_tmpfs_ia32.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_loop_compress_local-pkgs_record-pkgs_pack-to_armv7l.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_loop_config_cmpress_runtime_ia32.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_loop_logfile_conf_shrink_release_pkgmgr_armv7l.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_loop_shrink_outdir_logfile_pkgmgr_ia32.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_qcow_check-pkgs_tmpfs_ia32.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_qcow_config_runtime_ia32.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_qcow_local-pkgs_record-pkgs.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_qcow_logfile_conf_release_pkgmgr.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_raw_generate-bmap_cp-knl_compress_runtime_local-pkgs_conf_armv7l.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_raw_gpt-part-type.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_raw_install_more_pakcates.case [new file with mode: 0644]
cases/create/func_cases/mic_cr_raw_release_logfile_local-pkg-pth_record-pkg_gen-bmap_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/check_install_packages_number_display.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_auto_arm64.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_auto_with_encoded_password.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_auto_with_separate_password.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_auto_with_un-encoded_password.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_createrepo_issue.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_fs_bootstrap_check_chroot.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_fs_check_high_version_rpm_installed.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_fs_duplicate_log_native.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_fs_native_check_chroot.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_fs_obsolete_pkg_test.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_fs_prefix-conf_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_fs_priority.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_fs_without_conf_bootstrap_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_fs_without_conf_native_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_livecd_bootstrap_check_chroot.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_livecd_duplicate_log_native.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_livecd_prefix-conf_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_livecd_with_partition_label.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_livecd_without_conf_bootstrap_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_livecd_without_conf_native_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_liveusb_bootstrap_check_chroot.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_liveusb_duplicate_log_native.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_liveusb_excludepkgs_issue_1066.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_liveusb_includepkgs.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_liveusb_prefix-conf_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_liveusb_release_record-pkgs_.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_liveusb_with_partition_label.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_liveusb_without_conf_bootstrap_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_liveusb_without_conf_native_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_bootstrap_check_chroot.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_bootstrap_issue_1093.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_check_arch.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_check_md5sum.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_check_user_and_group_info.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_conf_difference.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_conf_etc_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_duplicate_log_native.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_full_ks.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_issue_794.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_ks-under-root-directory_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_multi_partition.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_native_check_chroot.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_native_issue_1093.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_no-cache.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_only_local_repo.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_overridden.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_pack-to-tar-gz_multi_times.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_prefix-conf_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_release_ia32_bug.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_repo_local_repo.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_without_conf_bootstrap_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_without_conf_native_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_loop_without_var_lock.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_active_partition.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_broken_bootstrap.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_check-bootflag_gpt.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_check-bootflag_mbr.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_duplicate_log_native.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_installerfw_extlinux.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_installerfw_fstab.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_invliad_mic-bootstrap.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_ivi_partition_size_compute_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_locale.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_multi_partition_gpt.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_multi_partition_mbr.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_no_mountpoint.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_no_partition.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_prefix-conf_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_proxy_in_ks_native.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_release_record-pkgs_yum.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_unicode.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_without_conf_bootstrap_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_raw_without_conf_native_ia32.case [new file with mode: 0644]
cases/create/mixed_cases/mic_cr_strict_mode_image.case [new file with mode: 0644]
cases/create/mixed_cases/mic_duplicate_log.case [new file with mode: 0644]
cases/create/mixed_cases/mic_man_page.case [new file with mode: 0644]
cases/create/neg_cases/mic_cr_failed_release_log.case [new file with mode: 0644]
cases/create/neg_cases/mic_cr_fs_no_mountpoint.case [new file with mode: 0644]
cases/create/neg_cases/mic_cr_loop_compress-image_wrong-format.case [new file with mode: 0644]
cases/create/neg_cases/negative_command_without_ks_file.case [new file with mode: 0644]
cases/create/neg_cases/negative_error-ks-with-chinese.case [new file with mode: 0644]
cases/create/neg_cases/negative_error-package-ks.case [new file with mode: 0644]
cases/create/neg_cases/negative_error-repo-ks.case [new file with mode: 0644]
cases/create/neg_cases/negative_error_proxy_conf.case [new file with mode: 0644]
cases/create/neg_cases/negative_error_proxy_conf_logfile.case [new file with mode: 0644]
cases/create/neg_cases/negative_mic_cr_auto_without_autoline.case [new file with mode: 0644]
cases/create/neg_cases/negative_no-package-ks.case [new file with mode: 0644]
cases/create/neg_cases/negative_no-repo-ks.case [new file with mode: 0644]
cases/create/neg_cases/negative_non-existed-package.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_auto_liveusb.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_include-src_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_include-src_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_pack-to-tar-bz2_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_pack-to-tar-gz_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_pack-to-tar_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_pack-to-tbz_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_pack-to-tgz_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_record-pkgs-name-content-license-vcs_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_record-pkgs-name-content-license-vcs_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_runtime-bootstrap_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_fs_runtime-native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_livecd.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_liveusb.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_liveusb_copy-kernel_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_liveusb_pack-to-tar-gz_native.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_arc-invalid_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_arc_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_arch-vague_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_cache-current-dir_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_cache-current-dir_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_cache-root-dir_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_cache-root-dir_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_compress-image-bz2_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_compress-image-gz_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_compress-image-invalid_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_compress-image-lzo_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_conf_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_conf_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_copy-kernel_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_debug_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_interactive_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_local-pkg-path_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_local-pkg-path_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_logfile-current-dir_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_logfile-current-file_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_logfile-current-file_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_logfile-root-file_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_outdir-current-dir_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_outdir-current-dir_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_outdir-root-dir_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_outdir-root-dir_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-Invalid_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tar-bz2_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tar-bz2_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tar-bz_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tar-gz_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tar-gz_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tar-lzo_native.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tar_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tar_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-taz.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tbz2_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tbz_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tgz.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-tzo_native.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-zip_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pack-to-zip_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pkgmgr-Invalid_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pkgmgr-yum_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pkgmgr-zypp_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_pkgmgr-zypp_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_record-pkgs-Invalid_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_record-pkgs-name-content-license-vcs_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_record-pkgs-name-content-license-vcs_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_release_check_log_completeness.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_release_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_release_latest_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_release_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_repo_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_runtime-Invalid_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_runtime-bootstrap_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_runtime-native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_shrink_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_loop_tmpfs.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_proxy_in_custom_conf.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_proxy_in_terminal.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_qcow_logfile-current-file_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_compress-image-bz2_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_compress-image-gz_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_compress-image-invalid_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_compress-image-lzo_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_fstab-entry-name.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_fstab-entry-uuid.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_fstab-name_gpt_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_fstab-name_native.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_fstab-uuid_gpt_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_fstab-uuid_native.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_generate-bmap_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_generate-bmap_ia32_native.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_install-pkgs_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_native_conf_proxy.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_pack-to-tar-gz_native_ia32.case [new file with mode: 0644]
cases/create/opt_cases/mic_cr_raw_proxy_with_authentication.case [new file with mode: 0644]
coveragerc [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0644]
fixtures/conf/mic.conf [new file with mode: 0644]
fixtures/conf/mic_error.conf [new file with mode: 0644]
fixtures/conf/mic_native.conf [new file with mode: 0644]
fixtures/conf/mic_prefix.conf [new file with mode: 0644]
fixtures/conf/mic_proxy.conf [new file with mode: 0644]
fixtures/conf/mic_proxy_with_authentication.conf [new file with mode: 0644]
fixtures/conf/no_proxy_on.conf [new file with mode: 0644]
fixtures/conf/proxy_on.conf [new file with mode: 0644]
fixtures/conf/sysconfig_proxy [new file with mode: 0644]
fixtures/ks_files/RD-PQ.ks [new file with mode: 0644]
fixtures/ks_files/arm64.ks [new file with mode: 0644]
fixtures/ks_files/armv7l.ks [new file with mode: 0644]
fixtures/ks_files/armv7l_with_arch.ks [new file with mode: 0644]
fixtures/ks_files/createrepo_issue.ks [new file with mode: 0644]
fixtures/ks_files/error_auto.ks [new file with mode: 0644]
fixtures/ks_files/error_ks_with_chinese.ks [new file with mode: 0644]
fixtures/ks_files/error_no_package.ks [new file with mode: 0644]
fixtures/ks_files/error_no_repo.ks [new file with mode: 0644]
fixtures/ks_files/error_package.ks [new file with mode: 0644]
fixtures/ks_files/error_repo.ks [new file with mode: 0644]
fixtures/ks_files/gnome-live-gpt.ks [new file with mode: 0644]
fixtures/ks_files/gnome-live-label.ks [new file with mode: 0644]
fixtures/ks_files/gnome-live.ks [new file with mode: 0644]
fixtures/ks_files/gnome_exclude.ks [new file with mode: 0644]
fixtures/ks_files/gnome_include.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay_fs.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay_localrepo.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay_localrepo_test.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay_no_mountpoint.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay_priority.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay_test_repo.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay_with_encoded_passwd.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay_with_passwd.ks [new file with mode: 0644]
fixtures/ks_files/handset_blackbay_with_separate_passwd.ks [new file with mode: 0644]
fixtures/ks_files/ivi-2.0-alpha-debuginfo.ks [new file with mode: 0644]
fixtures/ks_files/ivi-mbr-i586-with-proxy.ks [new file with mode: 0644]
fixtures/ks_files/ivi-mbr-i586.ks [new file with mode: 0644]
fixtures/ks_files/ivi.ks [new file with mode: 0644]
fixtures/ks_files/ivi_624.ks [new file with mode: 0644]
fixtures/ks_files/ivi_broken_content_bootstrap.ks [new file with mode: 0644]
fixtures/ks_files/ivi_four_partition_gpt.ks [new file with mode: 0644]
fixtures/ks_files/ivi_four_partition_mbr.ks [new file with mode: 0644]
fixtures/ks_files/ivi_gpt_with_part-type.ks [new file with mode: 0644]
fixtures/ks_files/ivi_invalid_content_mic-bootstrap.ks [new file with mode: 0644]
fixtures/ks_files/ivi_no_mountpoint.ks [new file with mode: 0644]
fixtures/ks_files/ivi_no_partition.ks [new file with mode: 0644]
fixtures/ks_files/ivi_packages.ks [new file with mode: 0644]
fixtures/ks_files/ivi_syslinux_problem.ks [new file with mode: 0644]
fixtures/ks_files/ivi_with_active_partition.ks [new file with mode: 0644]
fixtures/ks_files/ivi_with_active_partition_gpt.ks [new file with mode: 0644]
fixtures/ks_files/ivi_with_installerfw.ks [new file with mode: 0644]
fixtures/ks_files/obsolete_test_one.ks [new file with mode: 0644]
fixtures/ks_files/obsolete_test_two.ks [new file with mode: 0644]
fixtures/ks_files/qcow_image.ks [new file with mode: 0644]
fixtures/ks_files/strict_mode.ks [new file with mode: 0644]
fixtures/ks_files/whole_rd_210.ks [new file with mode: 0644]
fixtures/py_scripts/test_logging.py [new file with mode: 0644]
fixtures/rpm/A-2.0-1.x86_64.rpm [new file with mode: 0644]
fixtures/rpm/AA-1.0-1.x86_64.rpm [new file with mode: 0644]
fixtures/rpm/AAA-1.0-1.x86_64.rpm [new file with mode: 0644]
fixtures/rpm/pri_rpm/fake-1.0-1.i586.rpm [new file with mode: 0644]
fixtures/rpm/pri_rpm/fake-2.0-1.i586.rpm [new file with mode: 0644]
fixtures/rpm/sed-4.1.5-2.2.armv7l.rpm [new file with mode: 0644]
fixtures/rpm/sed-4.2.1-1.3.i686.rpm [new file with mode: 0644]
fixtures/rpm/strict_mode_rpm/hello-1.0-1.x86_64.rpm [new file with mode: 0644]
fixtures/scripts/compute_space.sh [new file with mode: 0644]
fixtures/scripts/compute_volume.sh [new file with mode: 0644]
packaging/.gitignore [new file with mode: 0644]
packaging/Makefile [new file with mode: 0644]
packaging/itest-cases-mic.changes [new file with mode: 0644]
packaging/itest-cases-mic.dsc [new file with mode: 0644]
packaging/itest-cases-mic.spec [new file with mode: 0644]
report.html [new file with mode: 0644]
settings.py [new file with mode: 0644]
sudoers.itest_cases_mic [new file with mode: 0644]
tmp_ignore/mic_cr_livecd_native_check_chroot.case [new file with mode: 0644]
tmp_ignore/mic_cr_liveusb_native_check_chroot.case [new file with mode: 0644]
tmp_ignore/mic_cr_loop_conf_not_current_dir_ia32.case [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..f4897cd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,13 @@
+TARGET_PATH=$(PREFIX)/srv/itest/cases/mic
+SOURCES="cases fixtures settings.py coveragerc report.html"
+
+build:
+       @echo done
+
+install:
+       install -d $(TARGET_PATH)
+       for src in $(SOURCES); do \
+               cp -avr $$src $(TARGET_PATH); \
+       done
+       install -d $(PREFIX)/etc/sudoers.d
+       install -m 0440 sudoers.itest_cases_mic $(PREFIX)/etc/sudoers.d/itest_cases_mic
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..e294c6c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+This project contains functional test cases for mic.
+
+And all these test cases are written in format of itest tools.
diff --git a/cases/create/func_cases/mic_cr_auto_fs.case b/cases/create/func_cases/mic_cr_auto_fs.case
new file mode 100644 (file)
index 0000000..a96195e
--- /dev/null
@@ -0,0 +1,41 @@
+<testcase>
+    <summary>test 'mic cr auto ks' for fs type
+        if we run command with 'auto', mic will use the first line in ks file, which called magic line, and
+        magic line in this ks file is:
+        # -*-mic2-options-*- -f fs --pack-to=@NAME@-rs.tar.gz -*-mic2-options-*-
+    </summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay_fs.ks" />
+        <content target="parse_manifest.py">
+import sys
+import json
+img_file = sys.argv[1]
+mic_version = sys.argv[2]
+manifest_file=open('mic-output/manifest.json')
+manifest=json.load(manifest_file)
+assert manifest['format'] == 'fs'
+assert manifest['version'] == mic_version
+assert manifest['fs']['pack'] == '.tar.gz'
+assert img_file in manifest['fs']['image_files']
+      </content>
+    </fixtures>
+    <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  auto handset_blackbay_fs.ks --logfile=log.file
+grep "Finished" log.file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+fs_dir=$(ls mic-output/ | grep 'handset_blackbay_fs-.*-rs.tar.gz')
+mic_version=$(mic --version | awk '{print $2}')
+python parse_manifest.py $fs_dir $mic_version
+
+]]>
+    </steps>
+    <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf mic-output
+]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_auto_loop.case b/cases/create/func_cases/mic_cr_auto_loop.case
new file mode 100644 (file)
index 0000000..ef9255a
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>test 'mic cr auto ks' for loop type
+if we run command with 'auto', mic will use the first line in ks file,
+which called magic line, and magic line in this ks file is:
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+  </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr auto handset_blackbay.ks -d -v --logfile=log.file
+grep "Finished" log.file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+ls mic-output/ | grep 'handset_blackbay-.*-rs.zip'
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_auto_qcow.case b/cases/create/func_cases/mic_cr_auto_qcow.case
new file mode 100644 (file)
index 0000000..051658d
--- /dev/null
@@ -0,0 +1,46 @@
+<testcase>
+  <summary>test 'mic cr auto ks' for qcow type
+if we run command with 'auto', mic will use the first line in ks file,
+which called magic line, and magic line in this ks file is:
+# -*-mic2-options-*- -f qcow  -*-mic2-options-*-
+  </summary>
+  <fixtures>
+    <copy src="ks_files/qcow_image.ks" />
+  </fixtures>
+  <steps><![CDATA[
+
+losetup_path=$(sudo which losetup)
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+sudo mic cr auto qcow_image.ks -d -v --logfile=log.file -k /home/build/mic-tmp-cache
+
+# use '-k /home/build/mic-tmp-cache', because directory '/home/build/' has larger space, if
+# use default cache dir, mic will throw error 'Failed to umount /var/***/install_root' on
+# Ubuntu_12.04_64bit qemu-kvm
+
+grep "Finished" log.file
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+sudo test -f ./mic-output/emulimg-3.0.img
+
+file ./mic-output/emulimg-3.0.img | grep -i "QCOW"
+
+]]></steps>
+  <teardown><![CDATA[
+
+echo "cleaning..."
+
+test -d ./mic-output && sudo rm -rf mic-output
+
+test -d /home/build/mic-tmp-cache && sudo rm -rf /home/build/mic-tmp-cache
+
+echo "finish cleaning"
+
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_auto_raw.case b/cases/create/func_cases/mic_cr_auto_raw.case
new file mode 100644 (file)
index 0000000..f372370
--- /dev/null
@@ -0,0 +1,99 @@
+<testcase>
+  <summary>test 'mic cr auto ks' for raw  type
+if we run command with 'auto', mic will use the first line in ks file,
+which called magic line, and magic line in this ks file is:
+ -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+  </summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+    <content target="parse_manifest.py">
+import sys
+import json
+img_file = sys.argv[1]
+mic_version = sys.argv[2]
+bmap_file = sys.argv[3]
+manifest_file=open('mic-output/manifest.json')
+manifest=json.load(manifest_file)
+assert manifest['format'] == 'raw'
+assert manifest['version'] == mic_version
+assert manifest['raw']['compress'] == 'bz2'
+assert img_file in manifest['raw']['image_files']
+assert 'sdb' in manifest['raw']['disks']
+assert manifest['raw']['sdb']['bmap'] == bmap_file
+assert manifest['raw']['sdb']['image'] == img_file
+    </content>
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr auto ivi.ks --logfile=log.file -d -v 
+grep "Finished" log.file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+ls mic-output/ | grep 'ivi-.*-sdb.bmap'
+ls mic-output/ | grep 'ivi-.*-sdb.raw.bz2'
+ls mic-output/ | grep 'ivi-.*-vmlinuz-*'
+bz2img=$(ls mic-output/ | grep 'ivi-.*-sdb.raw.bz2')
+bmap=$(ls mic-output/ | grep 'ivi-.*-sdb.bmap')
+sudo bunzip2 -d mic-output/$bz2img
+raw_image=$(ls mic-output/ivi-*-sdb.raw)
+sudo mkdir -p mic-output/ivi_dir/boot
+kpartx_path=$(sudo which kpartx)
+loop_device=$(sudo $losetup_path -f)
+sudo $losetup_path $loop_device $raw_image
+for i in {1..5}
+do
+    kpartx_output=$(sudo $kpartx_path -av $loop_device)
+    if [ -n "$kpartx_output" ]; then
+        first_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '1p')
+        second_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '2p')
+        if [ -n "$first_part" ] && [ -n "$second_part" ];then
+            for j in {1..5}
+            do
+                ls /dev/mapper/
+                if [ -e "/dev/mapper/$first_part" ] && [ -e "/dev/mapper/$second_part" ];then
+                    sudo mount /dev/mapper/$first_part  mic-output/ivi_dir/boot/ -t ext4
+                    sudo mount /dev/mapper/$second_part  mic-output/ivi_dir/ -t ext4
+                    (! sudo chroot mic-output/ivi_dir/ cat /etc/fstab | grep /dev/sdb)
+                    sudo chroot mic-output/ivi_dir/ cat /etc/fstab | grep -i 'uuid'
+                    mic_version=$(mic --version | awk '{print $2}')
+                    python parse_manifest.py $bz2img $mic_version $bmap
+                    exit 0
+                else
+                    sleep 2
+                fi
+            done
+        fi
+    fi
+    sleep 3
+done
+echo "can not get kpartx output: $kpartx_path -av $raw_image"
+exit 1
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo test -f log.file && sudo rm -f log.file
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+loop_devices=$(sudo $losetup_path -a | awk -F ":" '{print $1}')
+raw_image=$(ls mic-output/ivi-*-sdb.raw)
+for i in {1..5}
+do
+    for loop_device in $loop_devices
+    do
+        test -d mic-output/ivi_dir && sudo umount -l mic-output/ivi_dir
+        test -d mic-output/ivi_dir/boot && sudo umount -l mic-output/ivi_dir/boot
+        kpartx_path=$(sudo which kpartx)
+        sudo $kpartx_path -d $loop_device
+        sudo $losetup_path -d $loop_device
+    done
+    if sudo $losetup_path -a | grep 'ivi'; then
+        sleep 2
+    else
+        test -d mic-output && sudo rm -rf ./mic-output
+        break
+    fi
+done
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_auto_raw_gpt.case b/cases/create/func_cases/mic_cr_auto_raw_gpt.case
new file mode 100644 (file)
index 0000000..836753d
--- /dev/null
@@ -0,0 +1,76 @@
+<testcase>
+    <summary>create raw image with  gpt table and --part-type for partition</summary>
+    <fixtures>
+        <copy src="ks_files/ivi_with_installerfw.ks" />
+    </fixtures>
+    <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr auto ivi_with_installerfw.ks --logfile=log.file -d -v
+grep "Finished" log.file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+ls mic-output/ | grep 'ivi_with_installerfw-.*-sdb.bmap'
+ls mic-output/ | grep 'ivi_with_installerfw-.*-sdb.raw.bz2'
+ls mic-output/ | grep 'ivi_with_installerfw-.*-vmlinuz-*'
+bz2img=$(ls mic-output/ | grep 'ivi_with_installerfw-.*-sdb.raw.bz2')
+sudo bunzip2 -d mic-output/$bz2img
+raw_image=$(ls mic-output/ivi_with_installerfw-*-sdb.raw)
+sudo mkdir -p mic-output/ivi_dir/boot
+kpartx_path=$(sudo which kpartx)
+loop_device=$(sudo $losetup_path -f)
+sudo $losetup_path $loop_device $raw_image
+for i in {1..5}
+do
+    kpartx_output=$(sudo $kpartx_path -av $loop_device)
+    if [ -n "$kpartx_output" ]; then
+        first_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '1p')
+        second_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '2p')
+        if [ -n "$first_part" ] && [ -n "$second_part" ];then
+            for j in {1..5}
+            do
+                ls /dev/mapper/
+                if [ -e "/dev/mapper/$first_part" ] && [ -e "/dev/mapper/$second_part" ];then
+                    sudo mount /dev/mapper/$first_part  mic-output/ivi_dir/boot/ -t ext3
+                    sudo mount /dev/mapper/$second_part  mic-output/ivi_dir/ -t ext4
+                    sudo chroot mic-output/ivi_dir/ cat /etc/fstab | grep /dev/sdb
+                    (! sudo chroot mic-output/ivi_dir/ cat /etc/fstab | grep -i 'uuid')
+                    exit 0
+                else
+                    sleep 2
+                fi
+            done
+        fi
+    fi
+    sleep 3
+done
+echo "can not get kpartx output: $kpartx_path -av $raw_image"
+exit 1
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+raw_image=$(ls mic-output/ivi_with_installerfw-*-sdb.raw)
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+loop_devices=$(sudo $losetup_path -a | awk -F ":" '{print $1}')
+for i in {1..5}
+do
+    for loop_device in $loop_devices
+    do
+       test -d mic-output/ivi_dir && sudo umount -l mic-output/ivi_dir
+       test -d mic-output/ivi_dir/boot && sudo umount -l mic-output/ivi_dir/boot
+       kpartx_path=$(sudo which kpartx)
+       sudo $kpartx_path -d $loop_device
+       sudo $losetup_path -d $loop_device
+    done
+    if sudo $losetup_path -a | grep 'ivi_with_installerfw'; then
+       sleep 3
+    else
+       test -d mic-output && sudo rm -rf ./mic-output
+       break
+    fi
+done
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_fs_inc-src_cache-dir_arch_logfile_armv7l.case b/cases/create/func_cases/mic_cr_fs_inc-src_cache-dir_arch_logfile_armv7l.case
new file mode 100644 (file)
index 0000000..9758e45
--- /dev/null
@@ -0,0 +1,36 @@
+<testcase>
+    <summary>This test case is used to test the options "--include-src --logfile=fs_src.log -k fs_cache -A armv7l". All these options are used to test whether the image will be generated according to the given values.
+    </summary>
+    <fixtures>
+        <copy src="ks_files/armv7l.ks" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+enforce_path=$(sudo which setenforce || true)
+if [ ! -z $enforce_path ];then
+    sudo $enforce_path 0 || true
+fi
+sudo mic cr -d -v  fs armv7l.ks --include-src --logfile=fs_src.log -k fs_cache -A armv7l -o my_output
+test -d ./my_output
+test -f fs_src.log
+grep "Finished" fs_src.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -d fs_cache
+ls ./my_output | grep 'armv7l*'
+ls fs_cache/packages/Tizen-base | grep rpm
+sudo mic chroot ./my_output/armv7l* ls /usr/src/SRPMS/ | grep ".*\.rpm"
+]]>
+    </steps>
+    <teardown>
+    <![CDATA[
+echo "clean space...."
+sudo rm -rf fs_cache
+sudo rm fs_src.log
+sudo rm -rf my_output
+]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_fs_inc-src_cp-knl_cache-dir_ia32.case b/cases/create/func_cases/mic_cr_fs_inc-src_cp-knl_cache-dir_ia32.case
new file mode 100644 (file)
index 0000000..a692b61
--- /dev/null
@@ -0,0 +1,34 @@
+<testcase>
+    <summary>This test case is used to test the option "--include-src --copy-kernel --cachedir",
+        --include-src will put all rpm packages to /usr/src/SRPMS/, --copy-kernel will copy kernel file named as 'XXX-vmlinuz-XXX' to mic-output directory,
+        --cachedir will store all download packages to the specified directory, default is /var/tmp/mic/cache
+    </summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay.ks" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --include-src --copy-kernel --cachedir=./mic-cache  --logfile=log.file
+grep "Finished" log.file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+ls -l ./mic-output | grep 'handset_blackbay.*-vmlinuz-*'
+test -d mic-cache/
+ls -l mic-cache/packages/Tizen-base | grep rpm
+ls ./mic-output | grep "handset_blackbay-.*[0-9]$"
+CH_PATH=`ls ./mic-output | grep "handset_blackbay-.*[0-9]$"`
+cd ./mic-output
+echo $CH_PATH
+sudo chroot $CH_PATH ls /usr/src/SRPMS | grep ".*\.rpm"
+]]>
+    </steps>
+    <teardown>
+        <![CDATA[
+echo "clean space...."
+sudo rm -rf ./mic-output ./mic-cache ./log.file
+]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_fs_install-pkgs_ia32.case b/cases/create/func_cases/mic_cr_fs_install-pkgs_ia32.case
new file mode 100644 (file)
index 0000000..8785457
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>create fs image with ia32 arch and "--install-pkgs" option</summary>
+  <fixtures>
+    <copy src="ks_files/ivi-2.0-alpha-debuginfo.ks" />
+  </fixtures>
+  <steps>
+    <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs ivi-2.0-alpha-debuginfo.ks --install-pkgs=debuginfo  --logfile=mic1.log
+grep 'Finished' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+image_name=`ls ./mic-output | grep 'ivi-2.0-alpha-debuginfo'`
+test -d ./mic-output/$image_name
+sudo chroot ./mic-output/$image_name rpm -qa | grep 'debuginfo'
+]]>
+  </steps>
+  <teardown>
+    <![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output  mic1.log
+]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_loop_check-pkgs_tmpfs_ia32.case b/cases/create/func_cases/mic_cr_loop_check-pkgs_tmpfs_ia32.case
new file mode 100644 (file)
index 0000000..97d08f8
--- /dev/null
@@ -0,0 +1,34 @@
+<testcase>
+  <summary>Test option "check-pkgs".</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --tmpfs --check-pkgs=bash,rpm --logfile=handset1.log
+
+test -f handset1.log
+
+grep 'Finished' handset1.log
+
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f ./mic-output/platform.img
+
+sudo mic cr -d -v  loop handset_blackbay.ks --check-pkgs=bashrr --logfile=handset2.log 2>&1 | tee handset2.log || true
+grep "Packages absent in image: bashrr" handset2.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+
+sudo rm -rf ./mic-output
+
+sudo rm -rf handset1.log handset2.log
+
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_loop_compress_local-pkgs_record-pkgs_pack-to_armv7l.case b/cases/create/func_cases/mic_cr_loop_compress_local-pkgs_record-pkgs_pack-to_armv7l.case
new file mode 100644 (file)
index 0000000..7ea4c59
--- /dev/null
@@ -0,0 +1,49 @@
+<testcase>
+  <summary>create loop image with armv7l arch, and options is
+ "--local-pkgs-path=./rpm --record-pkgs=name,content,license --taring-to=@NAME@ --compress-image=bz2"</summary>
+  <fixtures>
+    <copy src="ks_files/armv7l.ks" />
+    <copydir src="rpm/" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+enforce_path=$(sudo which setenforce || true)
+if [ ! -z $enforce_path ];then
+    sudo $enforce_path 0 || true
+fi
+sudo mic cr -d -v  loop armv7l.ks \
+  --local-pkgs-path=./rpm \
+  --record-pkgs=name,content,license,vcs \
+  --taring-to=@NAME@ \
+  --compress-image=bz2 \
+  --logfile=log.file
+
+grep "Finished" log.file
+
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep 'Marking .*.rpm to be installed' log.file
+
+test -f ./mic-output/armv7l*.tar
+
+sudo tar -xvf ./mic-output/armv7l*.tar -C ./mic-output
+
+sudo test -f ./mic-output/platform.img.bz2
+
+sudo bunzip2 ./mic-output/platform.img.bz2
+
+sudo test -f ./mic-output/platform.img
+sudo ls ./mic-output | grep 'armv7l.*.packages'
+sudo ls ./mic-output | grep 'armv7l.*.license'
+sudo ls ./mic-output | grep 'armv7l.*.files'
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+
+sudo rm log.file
+
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_loop_config_cmpress_runtime_ia32.case b/cases/create/func_cases/mic_cr_loop_config_cmpress_runtime_ia32.case
new file mode 100644 (file)
index 0000000..818c713
--- /dev/null
@@ -0,0 +1,56 @@
+<testcase>
+  <summary>This test case is used to test the option
+  "--config, --compress-image, --runtime"
+  </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic.conf" />
+    <copy src="scripts/compute_volume.sh" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --config=mic.conf \
+  --compress-image=bz2 \
+  --runtime=bootstrap \
+  --logfile=mic1.log
+grep -i "Finished" mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep 'Start mic in bootstrap' mic1.log
+sudo rm mic1.log
+sudo test -d ./my_mic-output
+sudo test -e ./my_mic-output/platform.img.bz2
+sudo mic cr -d -v  loop handset_blackbay.ks --outdir=out2  --logfile=mic2.log
+grep "Finished" mic2.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo rm mic2.log
+sudo test -f ./out2/platform.img
+
+source compute_volume.sh
+
+p1=`compute_volume ./my_mic-output/platform.img.bz2`
+
+p2=`compute_volume ./out2/platform.img`
+
+result=`awk -v cpmpress_volume=$p1 -v before_volume=$p2 'BEGIN {print(before_volume>cpmpress_volume)?"yes":"no"}'`
+
+test $result = 'yes'
+
+cd my_mic-output
+
+sudo bunzip2 platform.img.bz2
+
+test -f platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+
+sudo rm -rf ./my_mic-output/ ./out2/
+
+echo "finish clean space...."
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_loop_logfile_conf_shrink_release_pkgmgr_armv7l.case b/cases/create/func_cases/mic_cr_loop_logfile_conf_shrink_release_pkgmgr_armv7l.case
new file mode 100644 (file)
index 0000000..d433800
--- /dev/null
@@ -0,0 +1,41 @@
+<testcase>
+  <summary>create loop image with armv7l arh, the option is
+"--logfile=/custome/arm.log -c conf/mic.conf --shrink --release=tizen-2.2_20130719.3 --pkgmgr=zypp"</summary>
+  <fixtures>
+    <copy src="ks_files/armv7l.ks" />
+    <copy src="conf/mic.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+# on some platforms, the command "setenforce 0" is needed to be executed,
+# on some other platforms, it's not needed to execute this command or 
+# no related package is installed, so we added "||"
+enforce_path=$(sudo which setenforce || true)
+if [ ! -z $enforce_path ];then
+    sudo $enforce_path 0 || true
+fi
+sudo mic cr -d -v  loop armv7l.ks --logfile=/custome/arm.log -c mic.conf --shrink --release=tizen-2.2_20130719.3 --pkgmgr=zypp
+
+sudo test -f /custome/arm.log
+
+grep "Finished" /custome/arm.log
+
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f my_mic-output/tizen-2.2_20130719.3/images/armv7l/MD5SUMS
+test -f my_mic-output/tizen-2.2_20130719.3/images/armv7l/boot.img
+test -f my_mic-output/tizen-2.2_20130719.3/images/armv7l/platform.img
+test -f my_mic-output/tizen-2.2_20130719.3/images/armv7l/tizen-2.2_20130719.3_armv7l.ks
+test -f my_mic-output/tizen-2.2_20130719.3/images/armv7l/tizen-2.2_20130719.3_armv7l.packages
+test -f my_mic-output/tizen-2.2_20130719.3/images/armv7l/tizen-2.2_20130719.3_armv7l.xml
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+
+sudo rm /custome/arm.log
+
+sudo rm -rf my_mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_loop_shrink_outdir_logfile_pkgmgr_ia32.case b/cases/create/func_cases/mic_cr_loop_shrink_outdir_logfile_pkgmgr_ia32.case
new file mode 100644 (file)
index 0000000..86569e7
--- /dev/null
@@ -0,0 +1,46 @@
+<testcase>
+  <summary>create loop image with ia32 arch and shrink option</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="scripts/compute_volume.sh" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -o out1 --pkgmgr=zypp  --logfile=mic1.log
+
+grep 'Finished' mic1.log
+
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f ./out1/platform.img
+
+sudo mic cr -d -v  loop handset_blackbay.ks -o out2 --shrink  --logfile=mic2.log
+
+grep 'Finished' mic2.log
+
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f ./out2/platform.img
+
+source compute_volume.sh
+
+p1=`compute_volume ./out1/platform.img`
+
+p2=`compute_volume ./out2/platform.img`
+
+result=`awk -v before_volume=$p1 -v cpmpress_volume=$p2 'BEGIN {print(before_volume>cpmpress_volume)?"yes":"no"}'`
+
+test $result = 'yes'
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+
+sudo rm -rf ./out1/ ./out2/
+
+sudo rm mic1.log mic2.log
+
+echo "finish clean space...."
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_qcow_check-pkgs_tmpfs_ia32.case b/cases/create/func_cases/mic_cr_qcow_check-pkgs_tmpfs_ia32.case
new file mode 100644 (file)
index 0000000..92f55e1
--- /dev/null
@@ -0,0 +1,54 @@
+<testcase>
+  <summary>Test option "check-pkgs".</summary>
+  <fixtures>
+    <copy src="ks_files/qcow_image.ks" />
+  </fixtures>
+  <steps><![CDATA[
+
+losetup_path=$(sudo which losetup)
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+sudo mic cr -d -v  qcow qcow_image.ks --tmpfs --check-pkgs=bash,rpm --logfile=qcow1.log -k /home/build/mic-tmp-cache
+
+# use '-k /home/build/mic-tmp-cache', because directory '/home/build/' has larger space, if
+# use default cache dir, mic will throw error 'Failed to umount /var/***/install_root' on
+# Ubuntu_12.04_64bit qemu-kvm
+
+test -f qcow1.log
+
+grep 'Finished' qcow1.log
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+test -f ./mic-output/emulimg-3.0.img
+
+file ./mic-output/emulimg-3.0.img | grep -i "QCOW"
+
+sudo mic cr -d -v  qcow qcow_image.ks --check-pkgs=bashrr --logfile=qcow2.log -k /home/build/mic-tmp-cache 2>&1 | tee qcow2.log || true
+
+grep "Packages absent in image: bashrr" qcow2.log
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+]]></steps>
+  <teardown><![CDATA[
+
+echo "cleaning..."
+
+sudo rm -rf ./mic-output
+
+sudo rm -f qcow1.log qcow2.log
+
+test -d /home/build/mic-tmp-cache && sudo rm -rf /home/build/mic-tmp-cache
+
+echo "finish cleaning..."
+
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_qcow_config_runtime_ia32.case b/cases/create/func_cases/mic_cr_qcow_config_runtime_ia32.case
new file mode 100644 (file)
index 0000000..9311e1e
--- /dev/null
@@ -0,0 +1,62 @@
+<testcase>
+  <summary>This test case is used to test the option
+  "--config, --runtime"
+  </summary>
+  <fixtures>
+    <copy src="ks_files/qcow_image.ks" />
+    <copy src="conf/mic.conf" />
+  </fixtures>
+  <steps><![CDATA[
+
+losetup_path=$(sudo which losetup)
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+# set tmpdir and roordir to /home/build to avoid space lacking during build
+sed -i 's!^\(tmpdir=\).*!\1 /home/build/mic/tmp!g' mic.conf
+sed -i 's!^\(rootdir=\).*!\1 /home/build/mic-bootstrap!g' mic.conf
+
+sudo mic cr -d -v  qcow qcow_image.ks \
+  --config=mic.conf \
+  --runtime=bootstrap \
+  --logfile=mic.log \
+  -k /home/build/mic-tmp-cache
+
+# use '-k /home/build/mic-tmp-cache', because directory '/home/build/' has larger space, if
+# use default cache dir, mic will throw error 'Failed to umount /var/***/install_root' on
+# Ubuntu_12.04_64bit qemu-kvm
+
+grep -i "Finished" mic.log
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+grep 'Start mic in bootstrap' mic.log
+
+sudo rm mic.log
+
+sudo test -f ./my_mic-output/emulimg-3.0.img
+
+file ./my_mic-output/emulimg-3.0.img | grep -i "QCOW"
+
+]]></steps>
+  <teardown><![CDATA[
+
+echo "cleaning...."
+
+sudo rm -rf ./my_mic-output/
+
+sed -i 's!^\(tmpdir=\).*!\1 /var/tmp/mic!g' mic.conf
+sed -i 's!^\(rootdir=\).*!\1 /var/tmp/mic-bootstrap!g' mic.conf
+
+test -d /home/build/mic-tmp-cache && sudo rm -rf /home/build/mic-tmp-cache
+
+echo "finish clean space...."
+
+echo "finish cleaning...."
+
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_qcow_local-pkgs_record-pkgs.case b/cases/create/func_cases/mic_cr_qcow_local-pkgs_record-pkgs.case
new file mode 100644 (file)
index 0000000..ded38ae
--- /dev/null
@@ -0,0 +1,65 @@
+<testcase>
+  <summary>create qcow image with armv7l arch, and options is
+ "--local-pkgs-path=./rpm --record-pkgs=name,content,license --taring-to=@NAME@"</summary>
+  <fixtures>
+    <copy src="ks_files/qcow_image.ks" />
+    <copydir src="rpm/" />
+  </fixtures>
+  <steps><![CDATA[
+
+losetup_path=$(sudo which losetup)
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+enforce_path=$(sudo which setenforce || true)
+
+if [ ! -z $enforce_path ];then
+    sudo $enforce_path 0 || true
+fi
+
+sudo mic cr -d -v  qcow qcow_image.ks \
+  --local-pkgs-path=./rpm \
+  --record-pkgs=name,content,license,vcs \
+  --taring-to=@NAME@ \
+  --logfile=log.file \
+  -k /home/build/mic-tmp-cache
+
+# use '-k /home/build/mic-tmp-cache', because directory '/home/build/' has larger space, if
+# use default cache dir, mic will throw error 'Failed to umount /var/***/install_root' on
+# Ubuntu_12.04_64bit qemu-kvm
+
+grep "Finished" log.file
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+grep 'Marking .*.rpm to be installed' log.file
+
+sudo test -f ./mic-output/emulimg-3.0.img
+
+file ./mic-output/emulimg-3.0.img | grep -i "QCOW"
+
+sudo ls ./mic-output | grep 'qcow_image.*.packages'
+
+sudo ls ./mic-output | grep 'qcow_image.*.license'
+
+sudo ls ./mic-output | grep 'qcow_image.*.files'
+
+]]></steps>
+  <teardown><![CDATA[
+
+echo "cleaning...."
+
+sudo rm log.file
+
+sudo rm -rf ./mic-output
+
+test -d /home/build/mic-tmp-cache && sudo rm -rf /home/build/mic-tmp-cache
+
+echo "finish cleaning...."
+
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_qcow_logfile_conf_release_pkgmgr.case b/cases/create/func_cases/mic_cr_qcow_logfile_conf_release_pkgmgr.case
new file mode 100644 (file)
index 0000000..6615073
--- /dev/null
@@ -0,0 +1,69 @@
+<testcase>
+  <summary>create qcow image with option
+"--logfile=/custome/arm.log -c conf/mic.conf --release=tizen-2.2_20130719.3 --pkgmgr=zypp"</summary>
+  <fixtures>
+    <copy src="ks_files/qcow_image.ks" />
+    <copy src="conf/mic.conf" />
+  </fixtures>
+  <steps><![CDATA[
+
+losetup_path=$(sudo which losetup)
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+# on some platforms, the command "setenforce 0" is needed to be executed,
+# on some other platforms, it's not needed to execute this command or
+# no related package is installed, so we added "||"
+
+enforce_path=$(sudo which setenforce || true)
+
+if [ ! -z $enforce_path ];then
+    sudo $enforce_path 0 || true
+fi
+
+# set tmpdir and roordir to /home/build to avoid space lacking during build
+sed -i 's!^\(tmpdir=\).*!\1 /home/build/mic/tmp!g' mic.conf
+sed -i 's!^\(rootdir=\).*!\1 /home/build/mic-bootstrap!g' mic.conf
+
+sudo mic cr -d -v  qcow qcow_image.ks --logfile=/custome/arm.log -c mic.conf --release=tizen-2.2_20130719.3 --pkgmgr=zypp -k /home/build/mic-tmp-cache
+
+# use '-k /home/build/mic-tmp-cache', because directory '/home/build/' has larger space, if
+# use default cache dir, mic will throw error 'Failed to umount /var/***/install_root' on
+# Ubuntu_12.04_64bit qemu-kvm
+
+sudo test -f /custome/arm.log
+
+grep "Finished" /custome/arm.log
+
+sudo $losetup_path -a
+
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+test -f my_mic-output/tizen-2.2_20130719.3/images/qcow_image/emulimg-3.0.img
+
+file my_mic-output/tizen-2.2_20130719.3/images/qcow_image/emulimg-3.0.img | grep -i "QCOW"
+
+test -f my_mic-output/tizen-2.2_20130719.3/images/qcow_image/tizen-2.2_20130719.3_qcow_image.ks
+
+test -f my_mic-output/tizen-2.2_20130719.3/images/qcow_image/tizen-2.2_20130719.3_qcow_image.packages
+
+]]></steps>
+  <teardown><![CDATA[
+
+echo "cleaning...."
+
+sudo rm /custome/arm.log
+
+sudo rm -rf my_mic-output
+
+sed -i 's!^\(tmpdir=\).*!\1 /var/tmp/mic!g' mic.conf
+sed -i 's!^\(rootdir=\).*!\1 /var/tmp/mic-bootstrap!g' mic.conf
+
+test -d /home/build/mic-tmp-cache && sudo rm -rf /home/build/mic-tmp-cache
+
+echo "finish cleaning...."
+
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_raw_generate-bmap_cp-knl_compress_runtime_local-pkgs_conf_armv7l.case b/cases/create/func_cases/mic_cr_raw_generate-bmap_cp-knl_compress_runtime_local-pkgs_conf_armv7l.case
new file mode 100644 (file)
index 0000000..4627a4f
--- /dev/null
@@ -0,0 +1,48 @@
+<testcase>
+  <summary>create raw image with "--generate-bmap --compress-disk-image=bz2 --copy-kernel --runtime=zypp --local-pkgs-path=rpm -c conf/mic.conf"</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+    <copy src="conf/mic.conf" />
+    <copydir src="rpm" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi.ks \
+  --generate-bmap \
+  --compress-disk-image=bz2 \
+  --copy-kernel \
+  --runtime=bootstrap \
+  --local-pkgs-path=rpm \
+  -c mic.conf \
+  --logfile=log.file
+
+grep "Finished" log.file
+
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep 'Marking .*.rpm to be installed' log.file
+
+ls -l ./my_mic-output | grep 'ivi.*-vmlinuz-*'
+
+test -f ./my_mic-output/ivi*.raw.bz2
+
+ls -al ./my_mic-output | grep 'ivi-.*-sdb.bmap'
+
+cd my_mic-output
+
+sudo bunzip2 ivi-*-sdb.raw.bz2
+
+test -f ivi*.raw
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+
+sudo rm log.file
+
+sudo rm -rf ./my_mic-output
+
+echo "finish clean space...."
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_raw_gpt-part-type.case b/cases/create/func_cases/mic_cr_raw_gpt-part-type.case
new file mode 100644 (file)
index 0000000..bf4f5a3
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>create raw image with  gpt table and --part-type for partition</summary>
+  <fixtures>
+    <copy src="ks_files/ivi_gpt_with_part-type.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+sudo mic cr raw ivi_gpt_with_part-type.ks -d -v --logfile=mic1.log
+
+grep 'Finished' mic1.log
+
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+test -f ./mic-output/ivi_gpt_with_part-type-*.raw
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+
+test -d ./mic-output && sudo rm -rf ./mic-output/
+
+test -f mic1.log && sudo rm mic1.log
+
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_raw_install_more_pakcates.case b/cases/create/func_cases/mic_cr_raw_install_more_pakcates.case
new file mode 100644 (file)
index 0000000..d0797e8
--- /dev/null
@@ -0,0 +1,77 @@
+<testcase>
+  <summary>
+    test all kinds of packages can be installed
+  </summary>
+  <fixtures>
+    <copy src="ks_files/ivi_packages.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi_packages.ks --logfile=log.file -d -v
+grep "Finished" log.file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+ls mic-output/ | grep 'ivi_packages-.*-sdb.raw'
+raw_image=$(ls mic-output/ivi_packages-*-sdb.raw)
+sudo mkdir -p mic-output/ivi_dir/boot
+kpartx_path=$(sudo which kpartx)
+loop_device=$(sudo $losetup_path -f)
+sudo $losetup_path $loop_device $raw_image
+for i in {1..5}
+do
+    kpartx_output=$(sudo $kpartx_path -av $loop_device)
+    if [ -n "$kpartx_output" ]; then
+        first_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '1p')
+        second_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '2p')
+        if [ -n "$first_part" ] && [ -n "$second_part" ];then
+            for j in {1..5}
+            do
+                ls /dev/mapper/
+                if [ -e "/dev/mapper/$first_part" ] && [ -e "/dev/mapper/$second_part" ];then
+                    sudo mount /dev/mapper/$first_part  mic-output/ivi_dir/boot/ -t ext4
+                    sudo mount /dev/mapper/$second_part  mic-output/ivi_dir/ -t ext4
+                    sudo mic chroot mic-output/ivi_dir/ rpm -qa | grep kernel | wc -l | xargs test 2 -eq
+                    sudo mic chroot mic-output/ivi_dir/ rpm -qa | grep bash | grep i686
+                    sudo mic chroot mic-output/ivi_dir/ rpm -qa | grep python-distribute
+                    sudo mic chroot mic-output/ivi_dir/ rpm -qa | grep mozilla
+                    sudo mic chroot mic-output/ivi_dir/ rpm -qa | grep desktop | wc -l | xargs test 4 -eq
+                    (! sudo chroot mic-output/ivi_dir/ rpm -qa | grep bluez)
+                    exit 0
+                else
+                    sleep 2
+                fi
+            done
+        fi
+    fi
+    sleep 3
+done
+echo "can not get kpartx output: $kpartx_path -av $raw_image"
+exit 1
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo test -f log.file && sudo rm -f log.file
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+loop_devices=$(sudo $losetup_path -a | awk -F ":" '{print $1}')
+for i in {1..5}
+do
+    for loop_device in $loop_devices
+    do
+        test -d mic-output/ivi_dir && sudo umount -l mic-output/ivi_dir
+        test -d mic-output/ivi_dir/boot && sudo umount -l mic-output/ivi_dir/boot
+        kpartx_path=$(sudo which kpartx)
+        sudo $kpartx_path -d $loop_device
+        sudo $losetup_path -d $loop_device
+    done
+    if sudo $losetup_path -a | grep 'ivi_packages'; then
+        sleep 2
+    else
+        test -d mic-output && sudo rm -rf ./mic-output
+        break
+    fi
+done
+]]></teardown>
+</testcase>
diff --git a/cases/create/func_cases/mic_cr_raw_release_logfile_local-pkg-pth_record-pkg_gen-bmap_ia32.case b/cases/create/func_cases/mic_cr_raw_release_logfile_local-pkg-pth_record-pkg_gen-bmap_ia32.case
new file mode 100644 (file)
index 0000000..58dcef3
--- /dev/null
@@ -0,0 +1,46 @@
+<testcase>
+  <summary>This test case is used to test the option "--logfile",
+  if a file name is given to it, images should be created successfully.
+  There is no need to give an existed file name, mic will create a new
+  file with the given name if the file does not exist at present.
+  </summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+    <copydir src="rpm" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi.ks \
+  --local-pkgs-path=./rpm \
+  --record-pkgs=name,content,license \
+  --release=tizen_20121223.1 \
+  --generate-bmap \
+  --logfile=log.file
+
+grep "Finished" log.file && echo 'mic command execution finished'
+
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep 'Marking .*.rpm to be installed' log.file
+
+sudo test -e ./log.file
+sudo test -d ./mic-output/tizen_20121223.1/images
+sudo test -f ./mic-output/tizen_20121223.1/images/ivi/tizen_20121223.1_ivi.packages
+sudo test -f ./mic-output/tizen_20121223.1/images/ivi/tizen_20121223.1_ivi.license
+sudo test -f ./mic-output/tizen_20121223.1/images/ivi/tizen_20121223.1_ivi.files
+sudo test -f ./mic-output/tizen_20121223.1/images/ivi/tizen_20121223.1_ivi-sdb.raw
+sudo test -f ./mic-output/tizen_20121223.1/images/ivi/tizen_20121223.1_ivi-sdb.bmap
+sudo test -f ./mic-output/tizen_20121223.1/images/ivi/MD5SUMS
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+
+sudo rm log.file
+
+sudo rm -rf ./mic-output
+
+echo "finish clean space...."
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/check_install_packages_number_display.case b/cases/create/mixed_cases/check_install_packages_number_display.case
new file mode 100644 (file)
index 0000000..4c6537f
--- /dev/null
@@ -0,0 +1,56 @@
+<testcase>
+  <summary>
+This test case is used to test mic output about
+installing package, before it shows error log 'install ....[15/14]'
+  </summary>
+  <tracking>
+    <ticket>534</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=./log/handset.log
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep 'Start mic in bootstrap' ./log/handset.log
+
+test -f ./mic-output/platform.img
+
+grep -o '\[\s*[0-9]\{1,\}\s*/\s*[0-9]\{1,\}\s*\]\s*$' ./log/handset.log | \
+  awk -F '[' '{print $2}' | \
+  awk -F ']' '{print $1}' > temp
+
+package_number=$(tail temp -n 1| awk -F '/' '{print $2}')
+
+len=$(cat temp | wc -l)
+
+test $package_number -eq $(($len-1))
+
+i=1
+for line in $(cat temp);do
+    num1=$(echo $line | awk -F '/' '{print $1}')
+
+    num2=$(echo $line | awk -F '/' '{print $2}')
+
+    if [ $i -eq 1 ] || [ $i -eq $len ];then
+      test $num1 -eq $num2
+    else
+      test $num1 -lt $num2
+    fi
+
+    i=$((i+1))
+done
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -f ./log/handset.log && sudo rm -rf ./log
+test -f temp && sudo rm -f temp
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_auto_arm64.case b/cases/create/mixed_cases/mic_cr_auto_arm64.case
new file mode 100644 (file)
index 0000000..f85d09c
--- /dev/null
@@ -0,0 +1,32 @@
+<testcase>
+    <summary>test 'mic cr auto ks' for arm64 arch
+      if we run command with 'auto', mic will use the first line in ks file, which is called magic line
+    </summary>
+    <fixtures>
+        <copy src="ks_files/arm64.ks" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+distro=$(python -c "import platform;print platform.linux_distribution()[0].lower().rstrip()")
+version=$(python -c "import platform;print platform.linux_distribution()[1].lower().rstrip()")
+if ([ $distro == 'opensuse' ] && [ $version == '13.1' ]) || [ $distro != 'opensuse' ]; then
+    losetup_path=$(sudo which losetup)
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+    sudo mic cr -d -v  auto arm64.ks --logfile=log.file --runtime=native
+    grep "Finished" log.file
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+    ls mic-output | grep 'arm64.*.tar.gz'
+fi
+    ]]>
+    </steps>
+    <teardown>
+        <![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d ./mic-output && sudo rm -rf ./mic-output
+echo "finish cleaning..."
+        ]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_auto_with_encoded_password.case b/cases/create/mixed_cases/mic_cr_auto_with_encoded_password.case
new file mode 100644 (file)
index 0000000..20f27df
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+    <summary>test repo with encoded password</summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay_with_encoded_passwd.ks"/>
+    </fixtures>
+    <steps>
+        <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr auto handset_blackbay_with_encoded_passwd.ks -d -v --logfile=log.file
+grep "Finished" log.file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! grep -i 'pass%40%2C%3A%25' log.file)
+ls mic-output/ | grep 'handset_blackbay_with_encoded_passwd-.*-rs.zip'
+]]>
+    </steps>
+    <teardown>
+        <![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf mic-output
+test -e log.file && sudo rm log.file
+echo "finish cleaning..."
+]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_auto_with_separate_password.case b/cases/create/mixed_cases/mic_cr_auto_with_separate_password.case
new file mode 100644 (file)
index 0000000..9719ec9
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+    <summary>test repo with seperate password</summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay_with_separate_passwd.ks"/>
+    </fixtures>
+    <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr auto handset_blackbay_with_separate_passwd.ks -d -v --logfile=log.file
+grep "Finished" log.file
+(! grep -i 'pass@,:%' log.file)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+ls mic-output/ | grep 'handset_blackbay_with_separate_passwd-.*-rs.zip'
+]]>
+    </steps>
+    <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf mic-output
+test -e log.file && sudo rm log.file
+echo "finish cleaning..."
+]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_auto_with_un-encoded_password.case b/cases/create/mixed_cases/mic_cr_auto_with_un-encoded_password.case
new file mode 100644 (file)
index 0000000..7ab41ba
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+    <summary>test repo with raw password</summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay_with_passwd.ks"/>
+    </fixtures>
+    <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr auto handset_blackbay_with_passwd.ks -d -v --logfile=log.file
+grep "Finished" log.file
+grep -i '123456' log.file && exit1
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+ls mic-output/ | grep 'handset_blackbay_with_passwd-.*-rs.zip'
+]]>
+    </steps>
+    <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf mic-output
+test -e log.file && sudo rm log.file
+echo "finish cleaning..."
+]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_createrepo_issue.case b/cases/create/mixed_cases/mic_cr_createrepo_issue.case
new file mode 100644 (file)
index 0000000..6054c0d
--- /dev/null
@@ -0,0 +1,51 @@
+<testcase>
+  <summary>Test whether repo created by 'createrepo' locally can be used by mic</summary>
+  <tracking>
+    <ticket>2261</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/createrepo_issue.ks" />
+    <copy src="rpm/sed-4.2.1-1.3.i686.rpm" />
+  </fixtures>
+  <steps><![CDATA[
+createrepo --version || True
+distro=$(python -c 'import platform;print platform.linux_distribution()[0].lower().rstrip()')
+echo $distro
+if [ "$distro" = "opensuse" ]; then
+ sudo zypper install -y --oldpackage createrepo-0.9.8
+fi
+
+
+if [ "$distro" = "fedora" ] || [ "$distro" = "centos" ]; then
+ sudo yum clean all
+ sudo yum install -y createrepo-0.9.8 --setopt=protected_multilib=false --nogpgcheck
+ sudo yum clean all
+ sudo rpm --rebuilddb
+ sudo yum install -y wget --nogpgcheck
+fi
+
+if [ "$distro" = "ubuntu" ] || [ "$distro" = "debian" ]; then
+  sudo apt-get install -y --force-yes createrepo=0.9.8
+fi
+
+createrepo --version || True
+mkdir -p /var/tmp/temp_repo
+mkdir -p /var/tmp/temp_repo/repodata
+mv sed-4.2.1-1.3.i686.rpm /var/tmp/temp_repo/
+wget http://download.tizen.org/snapshots/tizen/common/latest/repos/ia32-wayland/packages/repodata/group.xml
+mv group.xml /var/tmp/temp_repo/repodata
+wget http://download.tizen.org/snapshots/tizen/common/latest/repos/ia32-wayland/packages/repodata/patterns.xml
+mv patterns.xml /var/tmp/temp_repo
+createrepo -g /var/tmp/temp_repo/repodata/group.xml --database --unique-md-filenames /var/tmp/temp_repo
+(! sudo mic cr -d -v  auto createrepo_issue.ks --logfile=mic1.log)
+grep -i "Failed to download" mic1.log
+
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -d /var/tmp/temp_repo && sudo rm -rf /var/tmp/temp_repo
+test -e mic1.log && sudo rm mic1.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_fs_bootstrap_check_chroot.case b/cases/create/mixed_cases/mic_cr_fs_bootstrap_check_chroot.case
new file mode 100644 (file)
index 0000000..04742c5
--- /dev/null
@@ -0,0 +1,32 @@
+<testcase>
+  <summary>Test whether it is ok to chroot into the image</summary>
+    <fixtures>
+      <copy src="ks_files/handset_blackbay.ks" />
+    </fixtures>
+  <steps>
+    <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --logfile=./log/handset.log --runtime=bootstrap
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -e ./mic-output/handset_blackbay*
+bash -c "sudo mic chroot ./mic-output/handset_blackbay*" << EOF
+echo "Checking chroot"
+ls
+pwd
+echo "It's ok to chroot,jump out"
+EOF
+]]>
+  </steps>
+  <teardown>
+    <![CDATA[
+echo "cleaning..."
+sudo test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ./log/handset.log && sudo rm ./log/handset.log
+]]>
+  </teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_fs_check_high_version_rpm_installed.case b/cases/create/mixed_cases/mic_cr_fs_check_high_version_rpm_installed.case
new file mode 100644 (file)
index 0000000..6439a7a
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+    <summary>there are two bash rpms in the repo, one is bash4.1, the other one is bash4.3, bash 4.3 should be installed</summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay.ks" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --logfile=mic.log
+grep 'Finished' mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+hand_dir=$(ls mic-output | grep 'handset_blackbay')
+test -d mic-output/$hand_dir
+sudo chroot  mic-output/$hand_dir rpm -q bash | grep 4.3
+        ]]>
+    </steps>
+    <teardown>
+        <![CDATA[
+echo "cleaning..."
+test -d mic-output && sudo rm -rf ./mic-output
+test -f mic.log && sudo rm mic.log
+echo 'finish cleaning...'
+        ]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_fs_duplicate_log_native.case b/cases/create/mixed_cases/mic_cr_fs_duplicate_log_native.case
new file mode 100644 (file)
index 0000000..02b9282
--- /dev/null
@@ -0,0 +1,50 @@
+<testcase>
+  <summary>check whether the log generated by "--logfile"
+  have duplicated package number
+  </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --logfile=fs.log --runtime=native
+test -e fs.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep -ao "Installing.*" fs.log > tmp1.log
+awk -F '  ' '{print $NF}' tmp1.log > tmp2.log
+grep -ao "\[.*\]" tmp2.log > tmp3.log
+#check whether it has duplicated adjacent lines
+if $(uniq -d tmp3.log | grep '.*'); then
+    echo "Have duplicated adjacent lines"
+    exit 1
+fi
+
+Total_Pac=$(grep -ao "Packages: [0-9]* Total" fs.log | grep -ao "[0-9]*")
+
+#check whether it starts from [ 1/*]
+head -1 tmp3.log | grep "\[[[:space:]]*1\/$Total_Pac\]"
+
+#check whether it ends with "eg. [46/46]"
+tail -1 tmp3.log | grep "\[[[:space:]]*\($Total_Pac\)\/\1\]"
+
+#check whether the package number is sequential
+grep -ao "[0-9]*\/" tmp3.log > tmp4.log
+
+sed -i 's/\///' tmp4.log
+
+awk 'BEGIN{a=0} {if($1-a==1){a=$1}else{print"Not sequential";exit 1}}END{print "last number is:",a}' tmp4.log
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+
+test -e mic-output && sudo rm -rf mic-output
+test -e tmp1.log && sudo rm tmp1.log
+test -e tmp2.log && sudo rm tmp2.log
+test -e tmp3.log && sudo rm tmp3.log
+test -e tmp4.log && sudo rm tmp4.log
+test -e fs.log && sudo rm fs.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_fs_native_check_chroot.case b/cases/create/mixed_cases/mic_cr_fs_native_check_chroot.case
new file mode 100644 (file)
index 0000000..32df7a2
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>Test whether it is ok to chroot into the image</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <content target="check_chroot">
+echo "Checking chroot"
+ls
+pwd
+echo "It's ok to chroot,jump out"
+    </content>
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --logfile=./log/handset.log --runtime=native
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -e ./mic-output/handset_blackbay*
+bash -c "sudo mic chroot ./mic-output/handset_blackbay*" < check_chroot
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ./log/handset.log && sudo rm ./log/handset.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_fs_obsolete_pkg_test.case b/cases/create/mixed_cases/mic_cr_fs_obsolete_pkg_test.case
new file mode 100644 (file)
index 0000000..80ed46b
--- /dev/null
@@ -0,0 +1,45 @@
+<testcase>
+  <summary>
+    test if pkg AA obsoletes when pkg A is lower than certain version, mic should only install AA
+    A.spec:     version 2.0
+    AA.spec:    obsoletes A less than 1.0
+    AAA.spec:   obsoletes A less than 3.0
+  </summary>
+  <fixtures>
+    <copy src="ks_files/obsolete_test_two.ks" />
+    <copy src="ks_files/obsolete_test_one.ks" />
+    <copy src="rpm/A-2.0-1.x86_64.rpm" />
+    <copy src="rpm/AA-1.0-1.x86_64.rpm" />
+    <copy src="rpm/AAA-1.0-1.x86_64.rpm" />
+  </fixtures>
+  <steps><![CDATA[
+    sudo mkdir -p /home/build/tmp_repo1
+    sudo mkdir -p /home/build/tmp_repo2
+    sudo cp A-2.0-1.x86_64.rpm /home/build/tmp_repo1/
+    sudo cp AA-1.0-1.x86_64.rpm /home/build/tmp_repo1/
+    sudo cp A-2.0-1.x86_64.rpm /home/build/tmp_repo2/
+    sudo cp AAA-1.0-1.x86_64.rpm /home/build/tmp_repo2/
+    sudo createrepo /home/build/tmp_repo1
+    sudo createrepo /home/build/tmp_repo2
+    losetup_path=$(sudo which losetup)
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+    sudo mic cr -d -v  fs obsolete_test_two.ks --logfile=mic1.log
+    grep "Installing: A-.*" mic1.log
+    grep "Installing: AA-.*" mic1.log
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+    sudo mic cr -d -v  fs obsolete_test_one.ks --logfile=mic2.log
+    (! grep "Installing: A-.*" mic2.log)
+    grep "Installing: AAA-.*" mic2.log
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e mic1.log && sudo rm mic1.log
+test -e mic2.log && sudo rm mic2.log
+sudo test -e mic-output && sudo rm -rf mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_fs_prefix-conf_ia32.case b/cases/create/mixed_cases/mic_cr_fs_prefix-conf_ia32.case
new file mode 100644 (file)
index 0000000..0b8cf4a
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>Test "name_prefix = prefix" in mic.conf</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic_prefix.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --logfile=mic.log -c mic_prefix.conf
+test -f mic.log
+grep 'Finished' mic.log
+egrep 'mic [0-9]{1,2}\.[0-9]+' mic.log
+test -e ./mic-output/prefix-handset_blackbay*
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -e mic.log && sudo rm mic.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_fs_priority.case b/cases/create/mixed_cases/mic_cr_fs_priority.case
new file mode 100644 (file)
index 0000000..42f0fb1
--- /dev/null
@@ -0,0 +1,37 @@
+<testcase>
+    <summary>Test option "--priority", the smaller the value, the higher the priority.</summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay_priority.ks" />
+        <copydir src="rpm" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+for i in {1,2}
+do
+mkdir -p /home/build/tmp$i
+cp ./rpm/pri_rpm/fake-$i.0-1.i586.rpm /home/build/tmp$i/
+createrepo /home/build/tmp$i
+#create local repo "tmp*" which contains "fake-*.0-1.i586.rpm".
+done
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay_priority.ks --logfile=./log/handset.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+sudo chroot ./mic-output/handset_blackbay_priority* rpm -qa fake | grep fake-1.0
+#In handset_blackbay_priority.ks, fake-2.0*.rpm is located in the repo that has lower priority, so fake-1.0*.rpm is installed.
+    ]]>
+    </steps>
+    <teardown>
+        <![CDATA[
+echo "cleaning..."
+sudo test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ./log/handset.log && sudo rm ./log/handset.log
+test -e /home/build/tmp1 && sudo rm -rf /home/build/tmp1
+test -e /home/build/tmp2 && sudo rm /home/build/tmp2
+        ]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_fs_without_conf_bootstrap_ia32.case b/cases/create/mixed_cases/mic_cr_fs_without_conf_bootstrap_ia32.case
new file mode 100644 (file)
index 0000000..23a525e
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf,
+  fs image cannot be created in bootstrap mode
+  </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  fs handset_blackbay.ks --logfile=handset.log --runtime=bootstrap) 2>&1 | tee mic.log
+grep -i "Failed to download/install bootstrap package" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e handset.log && sudo rm handset.log
+test -e mic.log && sudo rm mic.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_fs_without_conf_native_ia32.case b/cases/create/mixed_cases/mic_cr_fs_without_conf_native_ia32.case
new file mode 100644 (file)
index 0000000..ef46763
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf, fs image can be created in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --logfile=handset.log --runtime=native
+test -f handset.log
+grep 'Finished' handset.log
+test -e ./mic-output/handset_blackbay*
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e handset.log && sudo rm handset.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_livecd_bootstrap_check_chroot.case b/cases/create/mixed_cases/mic_cr_livecd_bootstrap_check_chroot.case
new file mode 100644 (file)
index 0000000..af020fb
--- /dev/null
@@ -0,0 +1,22 @@
+<testcase>
+  <summary>Test whether it is ok to chroot into the image</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  livecd gnome-live.ks --logfile=gnome.log --runtime=bootstrap)
+test -f gnome.log
+grep "Can't get rpm binary: mic-bootstrap-x86-arm" gnome.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d mic-output && sudo rm -rf ./mic-output
+test -f gnome.log && sudo rm gnome.log
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_livecd_duplicate_log_native.case b/cases/create/mixed_cases/mic_cr_livecd_duplicate_log_native.case
new file mode 100644 (file)
index 0000000..45d2033
--- /dev/null
@@ -0,0 +1,47 @@
+<testcase>
+  <summary>check whether the log generated by "--logfile" have duplicated package number</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr livecd gnome-live.ks --logfile=livecd.log --runtime=native
+test -e livecd.log
+grep -a "Installing" livecd.log > tmp1.log
+awk -F '  ' '{print $NF}' tmp1.log > tmp2.log
+grep -ao "\[.*\]" tmp2.log > tmp3.log
+#check whether it has duplicated adjacent lines
+if $(uniq -d tmp3.log | grep '.*')
+then
+    echo "Have duplicated adjacent lines"
+    exit 1
+fi
+Total_Pac=$(grep -ao "Packages: [0-9]* Total" livecd.log | grep -o "[0-9]*")
+#check whether it starts from "[ 1/*]"
+head -1 tmp3.log | grep "\[[[:space:]]*1\/$Total_Pac\]" 
+#check whether it ends with "eg. [46/46]"
+tail -1 tmp3.log | grep "\[[[:space:]]*\($Total_Pac\)\/\1\]"
+#check whether the package number is sequential
+grep -ao "[0-9]*\/" tmp3.log > tmp4.log
+sed -i 's/\///' tmp4.log
+awk 'BEGIN{a=0} {if($1-a==1){a=$1}else{print"Not sequential";exit 1}}END{print "last number is:",a}' tmp4.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e mic-output && sudo rm -rf mic-output
+test -e tmp1.log && sudo rm tmp1.log
+test -e tmp2.log && sudo rm tmp2.log
+test -e tmp3.log && sudo rm tmp3.log
+test -e tmp4.log && sudo rm tmp4.log
+test -e livecd.log && sudo rm livecd.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_livecd_prefix-conf_ia32.case b/cases/create/mixed_cases/mic_cr_livecd_prefix-conf_ia32.case
new file mode 100644 (file)
index 0000000..07833eb
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>Test "name_prefix = prefix" in mic.conf</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+    <copy src="conf/mic_prefix.conf" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  livecd gnome-live.ks --runtime=native --logfile=mic.log -c mic_prefix.conf
+test -f mic.log
+grep 'Finished' mic.log
+egrep 'mic [0-9]{1,2}\.[0-9]+' mic.log
+test -e ./mic-output/prefix-gnome-live*.iso
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -e mic.log && sudo rm mic.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_livecd_with_partition_label.case b/cases/create/mixed_cases/mic_cr_livecd_with_partition_label.case
new file mode 100644 (file)
index 0000000..9da5c8b
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>test 'mic cr livecd ks' for livecd type, and '--label platform' added for partition in ks</summary>
+  <tracking>
+    <ticket>221</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/gnome-live-label.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  livecd gnome-live-label.ks --logfile=log.file --runtime=native
+grep "Finished" log.file
+ls mic-output/ | grep 'gnome-live-label-.*.iso'
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d ./mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_livecd_without_conf_bootstrap_ia32.case b/cases/create/mixed_cases/mic_cr_livecd_without_conf_bootstrap_ia32.case
new file mode 100644 (file)
index 0000000..2a3cfb3
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf, livecd image cannot be created in bootstrap mode</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  livecd gnome-live.ks --logfile=gnome.log --runtime=bootstrap) 2>&1 | tee mic.log
+grep -i "Failed to download/install bootstrap package" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e gnome.log && sudo rm gnome.log
+test -e mic.log && sudo rm mic.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_livecd_without_conf_native_ia32.case b/cases/create/mixed_cases/mic_cr_livecd_without_conf_native_ia32.case
new file mode 100644 (file)
index 0000000..8a5ded8
--- /dev/null
@@ -0,0 +1,30 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf, livecd image can be created in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  livecd gnome-live.ks --logfile=gnome.log --runtime=native
+test -f gnome.log
+grep 'Finished' gnome.log
+test -e ./mic-output/gnome-live*.iso
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e gnome.log && sudo rm gnome.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_liveusb_bootstrap_check_chroot.case b/cases/create/mixed_cases/mic_cr_liveusb_bootstrap_check_chroot.case
new file mode 100644 (file)
index 0000000..a973bcf
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>Test whether it is ok to chroot into the image</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  liveusb gnome-live.ks --logfile=gnome.log --runtime=bootstrap)
+test -f gnome.log
+grep "Can't get rpm binary: mic-bootstrap-x86-arm" gnome.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d mic-output && sudo rm -rf ./mic-output
+test -f gnome.log && sudo rm gnome.log
+echo 'finish cleaning...'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_liveusb_duplicate_log_native.case b/cases/create/mixed_cases/mic_cr_liveusb_duplicate_log_native.case
new file mode 100644 (file)
index 0000000..8bd1f91
--- /dev/null
@@ -0,0 +1,47 @@
+<testcase>
+  <summary>check whether the log generated by "--logfile" have duplicated package number</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr liveusb gnome-live.ks --logfile=liveusb.log --runtime=native
+test -e liveusb.log
+grep -a "Installing" liveusb.log > tmp1.log
+awk -F '  ' '{print $NF}' tmp1.log > tmp2.log
+grep -ao "\[.*\]" tmp2.log > tmp3.log
+#check whether it has duplicated adjacent lines
+if $(uniq -d tmp3.log | grep '.*')
+then
+    echo "Have duplicated adjacent lines"
+    exit 1
+fi
+Total_Pac=$(grep -ao "Packages: [0-9]* Total" liveusb.log | grep -o "[0-9]*")
+#check whether it starts from "[ 1/*]"
+head -1 tmp3.log | grep "\[[[:space:]]*1\/$Total_Pac\]"
+#check whether it ends with "eg. [46/46]"
+tail -1 tmp3.log | grep "\[[[:space:]]*\($Total_Pac\)\/\1\]"
+#check whether the package number is sequential
+grep -ao "[0-9]*\/" tmp3.log > tmp4.log
+sed -i 's/\///' tmp4.log
+awk 'BEGIN{a=0} {if($1-a==1){a=$1}else{print"Not sequential";exit 1}}END{print "last number is:",a}' tmp4.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e mic-output && sudo rm -rf mic-output
+test -e tmp1.log && sudo rm tmp1.log
+test -e tmp2.log && sudo rm tmp2.log
+test -e tmp3.log && sudo rm tmp3.log
+test -e tmp4.log && sudo rm tmp4.log
+test -e liveusb.log && sudo rm liveusb.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_liveusb_excludepkgs_issue_1066.case b/cases/create/mixed_cases/mic_cr_liveusb_excludepkgs_issue_1066.case
new file mode 100644 (file)
index 0000000..603b788
--- /dev/null
@@ -0,0 +1,35 @@
+<testcase>
+  <summary>test '--excludepkgs' option in repo for liveusb type</summary>
+  <fixtures>
+    <copy src="ks_files/gnome_exclude.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  liveusb gnome_exclude.ks \
+  --runtime=native \
+  --release=tizen-pc_20130716.3 \
+  --record-pkgs=name \
+  --logfile=log.file
+grep "Finished" log.file
+test -f mic-output/tizen-pc_20130716.3/images/gnome_exclude/tizen-pc_20130716.3_gnome_exclude.img
+test -f mic-output/tizen-pc_20130716.3/images/gnome_exclude/tizen-pc_20130716.3_gnome_exclude.packages
+grep 'wrt-devel.i686 0.8.198.3-1.3' mic-output/tizen-pc_20130716.3/images/gnome_exclude/tizen-pc_20130716.3_gnome_exclude.packages
+grep 'wrt-installer.i686 0.1.58.2-1.3'   mic-output/tizen-pc_20130716.3/images/gnome_exclude/tizen-pc_20130716.3_gnome_exclude.packages
+grep 'wrt-plugins-tizen.i686 0.4.32-3.2' mic-output/tizen-pc_20130716.3/images/gnome_exclude/tizen-pc_20130716.3_gnome_exclude.packages
+(! grep 'xhost' mic-output/tizen-pc_20130716.3/images/gnome_exclude/tizen-pc_20130716.3_gnome_exclude.packages) 
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d ./mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_liveusb_includepkgs.case b/cases/create/mixed_cases/mic_cr_liveusb_includepkgs.case
new file mode 100644 (file)
index 0000000..578c02b
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>test '--includepkgs' option in repo  for liveusb type</summary>
+  <fixtures>
+    <copy src="ks_files/gnome_include.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  liveusb gnome_include.ks --runtime=native --release=tizen-pc_20130716.3 --record-pkgs=name --logfile=log.file
+grep "Finished" log.file
+test -f mic-output/tizen-pc_20130716.3/images/gnome_include/tizen-pc_20130716.3_gnome_include.img
+test -f mic-output/tizen-pc_20130716.3/images/gnome_include/tizen-pc_20130716.3_gnome_include.packages
+grep 'wrt-devel.i686 0.8.198.3-4.2' mic-output/tizen-pc_20130716.3/images/gnome_include/tizen-pc_20130716.3_gnome_include.packages
+grep 'wrt-installer.i686 0.1.58.2-1.3' mic-output/tizen-pc_20130716.3/images/gnome_include/tizen-pc_20130716.3_gnome_include.packages
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d ./mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_liveusb_prefix-conf_ia32.case b/cases/create/mixed_cases/mic_cr_liveusb_prefix-conf_ia32.case
new file mode 100644 (file)
index 0000000..413ce78
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>Test "name_prefix = prefix" in mic.conf</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+    <copy src="conf/mic_prefix.conf" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  liveusb gnome-live.ks --runtime=native --logfile=mic.log -c mic_prefix.conf
+test -f mic.log
+grep 'Finished' mic.log
+egrep 'mic [0-9]{1,2}\.[0-9]+' mic.log
+test -e ./mic-output/prefix-gnome-live*.usbimg
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -e mic.log && sudo rm mic.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_liveusb_release_record-pkgs_.case b/cases/create/mixed_cases/mic_cr_liveusb_release_record-pkgs_.case
new file mode 100644 (file)
index 0000000..596c199
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>test 'mic cr liveusb ks --release=xx --record-pkgs=xx' for liveusb type</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  liveusb gnome-live.ks --runtime=native --release=tizen-pc_20121221.9 --record-pkgs=content --logfile=log.file
+grep "Finished" log.file
+test -f mic-output/tizen-pc_20121221.9/images/gnome-live/tizen-pc_20121221.9_gnome-live.img
+test -f mic-output/tizen-pc_20121221.9/images/gnome-live/tizen-pc_20121221.9_gnome-live.files
+test -f mic-output/tizen-pc_20121221.9/images/gnome-live/tizen-pc_20121221.9_gnome-live.packages
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d ./mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_liveusb_with_partition_label.case b/cases/create/mixed_cases/mic_cr_liveusb_with_partition_label.case
new file mode 100644 (file)
index 0000000..d18ba4b
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>test 'mic cr liveusb ks' for liveusb type, and '--label platform' added for partition in ks</summary>
+  <tracking>
+    <ticket>221</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/gnome-live-label.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  liveusb gnome-live-label.ks --runtime=native --logfile=log.file
+grep "Finished" log.file
+ls mic-output/ | grep 'gnome-live-label-.*.usbimg'
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d ./mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_liveusb_without_conf_bootstrap_ia32.case b/cases/create/mixed_cases/mic_cr_liveusb_without_conf_bootstrap_ia32.case
new file mode 100644 (file)
index 0000000..f699213
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf, liveusb image cannot be created in bootstrap mode</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  liveusb gnome-live.ks --logfile=gnome.log --runtime=bootstrap) 2>&1 | tee mic.log
+grep -i "Failed to download/install bootstrap package" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e gnome.log && sudo rm gnome.log
+test -e mic.log && sudo rm mic.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_liveusb_without_conf_native_ia32.case b/cases/create/mixed_cases/mic_cr_liveusb_without_conf_native_ia32.case
new file mode 100644 (file)
index 0000000..ae29ed8
--- /dev/null
@@ -0,0 +1,30 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf, liveusb image can be created in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  liveusb gnome-live.ks --logfile=gnome.log --runtime=native
+test -f gnome.log
+grep 'Finished' gnome.log
+test -e ./mic-output/gnome-live*.usbimg
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e gnome.log && sudo rm gnome.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_bootstrap_check_chroot.case b/cases/create/mixed_cases/mic_cr_loop_bootstrap_check_chroot.case
new file mode 100644 (file)
index 0000000..4fd5218
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>Test whether it is ok to chroot into the image</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=./log/handset.log
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+bash -c "sudo mic chroot ./mic-output/platform.img" << EOF
+echo "Checking chroot"
+ls
+pwd
+echo "It's ok to chroot,jump out"
+EOF
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ./log/handset.log && sudo rm ./log/handset.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_bootstrap_issue_1093.case b/cases/create/mixed_cases/mic_cr_loop_bootstrap_issue_1093.case
new file mode 100644 (file)
index 0000000..da90ebb
--- /dev/null
@@ -0,0 +1,42 @@
+<testcase>
+  <summary></summary>
+  <tracking>
+    <ticket>1093</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic_proxy.conf" />
+    <copy src="conf/sysconfig_proxy" />
+  </fixtures>
+  <steps><![CDATA[
+distro=$(python -c 'import platform;print platform.linux_distribution()[0].lower().rstrip()')
+if [[ "$distro" == "opensuse" ]]
+then
+    test -e /etc/sysconfig/proxy && sudo mv /etc/sysconfig/proxy /etc/sysconfig/proxy.bak
+else
+    sudo mkdir -p /etc/sysconfig/
+fi
+sudo cp sysconfig_proxy /etc/sysconfig/proxy
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --runtime=bootstrap -c mic_proxy.conf --logfile=mic.log
+test -e ./mic-output/platform.img
+test -e mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e mic.log && sudo rm mic.log
+distro=$(python -c 'import platform;print platform.linux_distribution()[0].lower().rstrip()')
+if [[ "$distro" == "opensuse" ]]
+then
+    test -e /etc/sysconfig/proxy.bak
+    sudo mv /etc/sysconfig/proxy.bak /etc/sysconfig/proxy
+else
+    test -e /etc/sysconfig/proxy
+    sudo rm -rf /etc/sysconfig/proxy
+fi
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_check_arch.case b/cases/create/mixed_cases/mic_cr_loop_check_arch.case
new file mode 100644 (file)
index 0000000..db3d69b
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>check if arch is right</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=mic.log
+grep 'Finished' mic.log
+grep 'Use detected arch i686' mic.log
+test -e mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -f mic.log && sudo rm mic.log
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_check_md5sum.case b/cases/create/mixed_cases/mic_cr_loop_check_md5sum.case
new file mode 100644 (file)
index 0000000..0dc28f5
--- /dev/null
@@ -0,0 +1,31 @@
+<testcase>
+  <summary>Test 'md5sum -c ' </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr loop handset_blackbay.ks --release=tizen-2.2_20130719.3 --logfile=mic.log
+grep "Finished" mic.log
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/MD5SUMS
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.packages
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.ks
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.xml
+pushd $(pwd)
+cd ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*
+sudo md5sum -c ./MD5SUMS
+sudo sha1sum -c ./SHA1SUMS
+sudo sha256sum -c ./SHA256SUMS
+popd
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_check_user_and_group_info.case b/cases/create/mixed_cases/mic_cr_loop_check_user_and_group_info.case
new file mode 100644 (file)
index 0000000..45c07b0
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>This test case is used to check the user/group info
+for output and cache directory, it's should be the current user</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -o out1 -k cache --logfile=log.file
+grep "Finished" log.file
+c_user=$(whoami)
+ls -l . | grep 'out1' | grep $c_user
+ls -l . | grep 'cache' | grep $c_user
+test -e out1/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d out1 && sudo rm -rf ./out1
+test -d cache && sudo rm -rf ./cache
+echo 'finished cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_conf_difference.case b/cases/create/mixed_cases/mic_cr_loop_conf_difference.case
new file mode 100644 (file)
index 0000000..1cb046f
--- /dev/null
@@ -0,0 +1,48 @@
+<testcase>
+  <summary>This test case is used to test the option "--config",
+the configue file is with different 'outdir', mic should create image in right directory.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic.conf" />
+    <copy src="conf/mic_proxy.conf" />
+  </fixtures>
+  <steps><![CDATA[
+sed -i 's/outdir= .\/mic-output/outdir=new_mic_output/' mic_proxy.conf
+grep 'new_mic_output' mic_proxy.conf
+if [ -f /etc/mic/mic.conf ]; then
+    sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+    sudo cp mic.conf /etc/mic/
+else
+    sudo cp mic.conf /etc/mic/
+fi
+# test bootstrap mode
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -c mic_proxy.conf  --logfile=log.file
+grep "Finished" log.file
+test -f ./new_mic_output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+# test native mode
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --config=mic_proxy.conf \
+  --runtime=native \
+  --logfile=log.file
+grep "Finished" log.file
+test -f ./new_mic_output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+if [ -f /etc/mic/mic.conf.bak ];then
+    sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+else
+    sudo rm -f /etc/mic/mic.conf
+fi
+test -f log.file && sudo rm log.file
+test -d new_mic_output && sudo rm -rf ./new_mic_output
+echo 'finish cleaning...'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_conf_etc_ia32.case b/cases/create/mixed_cases/mic_cr_loop_conf_etc_ia32.case
new file mode 100644 (file)
index 0000000..798703f
--- /dev/null
@@ -0,0 +1,20 @@
+<testcase>
+  <summary>Test whether mic find the conf which is not under current dir or 'ks' dir when running in bootstrap mode.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic.conf" />
+  </fixtures>
+  <steps><![CDATA[
+sudo cp mic.conf /etc
+sudo mic cr loop handset_blackbay.ks -c /etc/mic.conf --logfile=mic.log -d -v
+grep "Finished" mic.log
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo test -e mic-output && rm -rf mic-output
+sudo test -e mic.log && sudo rm mic.log
+sudo test -e /etc/mic.conf && sudo rm /etc/mic.conf
+echo 'finish cleaning...'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_duplicate_log_native.case b/cases/create/mixed_cases/mic_cr_loop_duplicate_log_native.case
new file mode 100644 (file)
index 0000000..26b320f
--- /dev/null
@@ -0,0 +1,42 @@
+<testcase>
+  <summary>check whether the log generated by "--logfile" have duplicated package number</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr loop handset_blackbay.ks --logfile=loop.log --runtime=native
+test -e loop.log
+grep -ao "Installing.*" loop.log > tmp1.log
+awk -F '  ' '{print $NF}' tmp1.log > tmp2.log
+grep -ao "\[.*\]" tmp2.log > tmp3.log
+#check whether it has duplicated adjacent lines
+if $(uniq -d tmp3.log | grep '.*')
+then
+    echo "Have duplicated adjacent lines"
+    exit 1
+fi
+Total_Pac=$(grep -ao "Packages: [0-9]* Total" loop.log | grep -ao "[0-9]*")
+#check whether it starts from [ 1/*]
+head -1 tmp3.log | grep "\[[[:space:]]*1\/$Total_Pac\]"
+#check whether it ends with "eg. [46/46]"
+tail -1 tmp3.log | grep "\[[[:space:]]*\($Total_Pac\)\/\1\]"
+#check whether the package number is sequential
+grep -ao "[0-9]*\/" tmp3.log > tmp4.log
+sed -i 's/\///' tmp4.log
+awk 'BEGIN{a=0} {if($1-a==1){a=$1}else{print"Not sequential";exit 1}}END{print "last number is:",a}' tmp4.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e mic-output && sudo rm -rf mic-output
+test -e tmp1.log && sudo rm tmp1.log
+test -e tmp2.log && sudo rm tmp2.log
+test -e tmp3.log && sudo rm tmp3.log
+test -e tmp4.log && sudo rm tmp4.log
+test -e loop.log && sudo rm loop.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_full_ks.case b/cases/create/mixed_cases/mic_cr_loop_full_ks.case
new file mode 100644 (file)
index 0000000..606329a
--- /dev/null
@@ -0,0 +1,52 @@
+<testcase>
+  <summary>This test case is used to test full part ks</summary>
+       <fixtures>
+               <copy src="ks_files/whole_rd_210.ks" />
+        <content target="parse_manifest.py">
+import sys
+import json
+img_file = sys.argv[1]
+mic_version = sys.argv[2]
+manifest_file=open('mic-output/manifest.json')
+manifest=json.load(manifest_file)
+assert manifest['format'] == 'loop'
+assert manifest['version'] == mic_version
+assert manifest['loop']['pack'] == '.tar.gz'
+assert img_file in manifest['loop']['image_files']
+assert manifest['loop']['partitions']['/'] == 'platform'
+assert manifest['loop']['partitions']['/opt'] == 'data'
+assert manifest['loop']['partitions']['/opt/usr'] == 'ums'
+      </content>
+       </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr auto whole_rd_210.ks -d -v --logfile=log.file
+grep "Finished" log.file
+sudo test -e ./mic-output/whole_rd_210-*.tar.gz
+img_file=$(ls mic-output | grep 'whole_rd_210-.*.tar.gz')
+sudo tar zxvf mic-output/whole_rd_210-*.tar.gz  -C mic-output/
+sudo test -f mic-output/platform.img
+sudo test -f mic-output/data.img
+sudo test -f mic-output/ums.img
+grep 'Copying attachment files' log.file
+sudo test -f mic-output/bootstub
+sudo test -f mic-output/cmdline
+sudo test -f mic-output/preos.manifest
+sudo test -f mic-output/vmlinuz-3.0.8-1.5-mfld-blackbay
+end_preinstall_line=$(grep 'Preinstall' -n log.file | sed -n '$p' | awk -F ':' '{print $1}')
+start_install_line=$(grep 'Install' -n log.file  | sed -n '2p' | awk -F ':' '{print $1}')
+test $start_install_line -gt $end_preinstall_line
+mic_version=$(mic --version | awk '{print $2}')
+sudo python parse_manifest.py $img_file $mic_version
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d mic-output && sudo rm -rf ./mic-output
+echo 'finished cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_issue_794.case b/cases/create/mixed_cases/mic_cr_loop_issue_794.case
new file mode 100644 (file)
index 0000000..0737866
--- /dev/null
@@ -0,0 +1,30 @@
+<testcase>
+  <summary>when modify /etc/mic/mic.conf, change "plugin_dir" to a different existing one, mic failed to find the specified plugin dir.</summary>
+  <tracking>
+    <ticket>794</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo cp -r /usr/lib/mic/plugins /
+sudo sed -i '/plugin_dir/s/\/usr\/lib\/mic\/plugins/\/\/plugins/' /etc/mic/mic.conf
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=mic.log --runtime=bootstrap
+grep "Finished" mic.log
+ls mic-output | grep "platform.img"
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=mic.log --runtime=native
+grep "Finished" mic.log
+ls mic-output | grep "platform.img"
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e /home/test/plugins && sudo rm -rf /home/test/plugins
+sudo sed -i '/plugin_dir/s/\/\/plugins/\/usr\/lib\/mic\/plugins/' /etc/mic/mic.conf
+test -e ./mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_ks-under-root-directory_ia32.case b/cases/create/mixed_cases/mic_cr_loop_ks-under-root-directory_ia32.case
new file mode 100644 (file)
index 0000000..5802596
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>create loop image with ia32 arch while ks file is located in /.</summary>
+  <tracking>
+    <ticket>672</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+sudo cp handset_blackbay.ks /
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop /handset_blackbay.ks --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e mic-output && sudo rm -rf mic-output
+test -e mic1.log && sudo rm mic1.log
+test -e /handset_blackbay.ks && sudo rm /handset_blackbay.ks
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_multi_partition.case b/cases/create/mixed_cases/mic_cr_loop_multi_partition.case
new file mode 100644 (file)
index 0000000..55034af
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>This test case is used to test loop type with multiple partitions, in which there is a swap parition</summary>
+  <fixtures>
+    <copy src="ks_files/RD-PQ.ks" />
+  </fixtures>
+  <steps><![CDATA[
+enforce_path=$(sudo which setenforce || true)
+if [ ! -z $enforce_path ];then
+   sudo $enforce_path 0 || true
+fi
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop RD-PQ.ks --logfile=log.file
+grep "Finished" log.file
+sudo test -e ./mic-output/platform.img
+sudo test -e ./mic-output/ums.img
+sudo test -e ./mic-output/data.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d mic-output && sudo rm -rf ./mic-output
+echo 'finished cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_native_check_chroot.case b/cases/create/mixed_cases/mic_cr_loop_native_check_chroot.case
new file mode 100644 (file)
index 0000000..c579375
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>Test whether it is ok to chroot into the image</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=./log/handset.log --runtime=native
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+bash -c "sudo mic chroot ./mic-output/platform.img" << EOF
+echo "Checking chroot"
+ls
+pwd
+echo "It's ok to chroot,jump out"
+EOF
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ./log/handset.log && sudo rm ./log/handset.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_native_issue_1093.case b/cases/create/mixed_cases/mic_cr_loop_native_issue_1093.case
new file mode 100644 (file)
index 0000000..325647b
--- /dev/null
@@ -0,0 +1,42 @@
+<testcase>
+  <summary></summary>
+  <tracking>
+    <ticket>1093</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic_proxy.conf" />
+    <copy src="conf/sysconfig_proxy" />
+  </fixtures>
+  <steps><![CDATA[
+distro=$(python -c 'import platform;print platform.linux_distribution()[0].lower().rstrip()')
+bit=$(python -c 'import platform;print platform.linux_distribution()[1].rstrip()')
+if [[ "$distro" == "opensuse" ]]; then
+    [[ "$bit" == "12.1" ]] && exit 0
+    test -e /etc/sysconfig/proxy && sudo mv /etc/sysconfig/proxy /etc/sysconfig/proxy.bak
+    sudo cp sysconfig_proxy /etc/sysconfig/proxy
+fi
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --runtime=native \
+  -c mic_proxy.conf \
+  --logfile=mic.log
+test -e ./mic-output/platform.img
+test -e mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+sudo rm -rf mic.log ./mic-output
+distro=$(python -c 'import platform;print platform.linux_distribution()[0].lower().rstrip()')
+if [[ "$distro" == "opensuse" ]]; then
+    test -e /etc/sysconfig/proxy.bak
+    sudo mv /etc/sysconfig/proxy.bak /etc/sysconfig/proxy
+else
+    test -e /etc/sysconfig/proxy
+    sudo rm -rf /etc/sysconfig/proxy
+fi
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_no-cache.case b/cases/create/mixed_cases/mic_cr_loop_no-cache.case
new file mode 100644 (file)
index 0000000..f404348
--- /dev/null
@@ -0,0 +1,42 @@
+<testcase>
+  <summary>Test option "--nocache", which is used in the "repo" line of ks file. when this option is added, mic will download the related rpms again instead of using the existing rpms that are already stored in the local cache.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --logfile=./log/handset1.log \
+  -k /var/tmp/my_cache
+test -f ./log/handset1.log
+grep 'Finished' ./log/handset1.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --logfile=./log/handset2.log \
+  -k /var/tmp/my_cache
+grep "43 Total, 43 Cached, 0 Missed"   ./log/handset2.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+# Add "--nocache" to ks file
+sed -i '/repo/ s/$/ --nocache/' handset_blackbay.ks
+
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=./log/handset3.log
+test -f ./log/handset3.log
+# MIC download these 43 packages again,so it shows "43 Missed".
+grep "43 Total, 0 Cached, 43 Missed"   ./log/handset3.log
+grep "Finished" ./log/handset3.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ./log/handset*.log && sudo rm ./log/handset*.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_only_local_repo.case b/cases/create/mixed_cases/mic_cr_loop_only_local_repo.case
new file mode 100644 (file)
index 0000000..ff13dff
--- /dev/null
@@ -0,0 +1,44 @@
+<testcase>
+  <summary>test if mic can create image sucessfully if only local repo supplied</summary>
+  <tracking>
+    <ticket>512</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="ks_files/handset_blackbay_localrepo.ks" />
+  </fixtures>
+  <steps><![CDATA[
+mount | grep mic | awk '{print $3}' | sort -r | sudo xargs umount -l || true
+sudo umount /home/build/tmp/mic/cache || true
+sudo rm -rf /home/build/tmp/mic/cache
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=mic1.log
+grep "Finished" mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+pwd_dir=$(pwd)
+cd /home/build/tmp/mic/cache/packages/Tizen-base
+sudo createrepo .
+cd /home/build/tmp/mic/cache/packages/Tizen-main
+sudo createrepo .
+cd $pwd_dir
+sudo mic cr -d -v  loop handset_blackbay_localrepo.ks -o out -k cache --logfile=mic2.log
+grep "Finished" mic2.log
+test -f out/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f mic1.log && sudo rm mic1.log
+test -f mic2.log && sudo rm mic2.log
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -d cache && sudo rm -rf cache
+test -d out && sudo rm -rf out
+test -e /home/build/tmp/mic/cache/packages/Tizen-base/repodata && sudo rm -rf /home/build/tmp/mic/cache/packages/Tizen-base/repodata
+test -e /home/build/tmp/mic/cache/packages/Tizen-main/repodata && sudo rm -rf /home/build/tmp/mic/cache/packages/Tizen-main/repodata
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_overridden.case b/cases/create/mixed_cases/mic_cr_loop_overridden.case
new file mode 100644 (file)
index 0000000..0194943
--- /dev/null
@@ -0,0 +1,33 @@
+<testcase>
+  <summary>mic create auto</summary>
+  <qa>
+    <prompt>Target image/dir.*already exists.*clean up and continue?(Y/n)</prompt>
+    <answer>Y</answer>
+  </qa>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=handset_auto.log
+grep 'Finished' handset_auto.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+time1=`stat mic-output/platform.img | grep -E "Access: [0-9]" | awk '{print $3}'`
+sleep 20
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=handset_auto_1.log
+grep 'Finished' handset_auto_1.log
+time2=` stat mic-output/platform.img | grep -E "Access: [0-9]" | awk '{print $3}'`
+test "$time1" != "$time2"
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e handset_auto.log && sudo rm handset_auto.log
+test -e handset_auto_1.log && sudo rm handset_auto_1.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_pack-to-tar-gz_multi_times.case b/cases/create/mixed_cases/mic_cr_loop_pack-to-tar-gz_multi_times.case
new file mode 100644 (file)
index 0000000..59a02ae
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>run ten times to testing 'pack to' option</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+for i in {1..10}; do
+    sudo mic cr -d -v  loop handset_blackbay.ks --pack-to=@NAME@.tar.gz --logfile=mic.log
+    grep 'Finished' mic.log
+    test -f ./mic-output/handset_blackbay*.tar.gz
+    sudo gunzip  ./mic-output/handset_blackbay*.tar.gz
+    sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+    sudo test -e ./mic-output/platform.img
+    sudo rm -rf mic-output
+    echo "$i"
+done
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e mic.log && sudo rm mic.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_prefix-conf_ia32.case b/cases/create/mixed_cases/mic_cr_loop_prefix-conf_ia32.case
new file mode 100644 (file)
index 0000000..a3f514f
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>Test "name_prefix = prefix" in mic.conf</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic_prefix.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=mic.log -c mic_prefix.conf
+test -f mic.log
+grep 'Finished' mic.log
+egrep 'mic [0-9]{1,2}\.[0-9]+' mic.log
+test -e ./mic-output/platform.img
+test -e ./mic-output/prefix-handset_blackbay*.xml
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -e mic.log && sudo rm mic.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_release_ia32_bug.case b/cases/create/mixed_cases/mic_cr_loop_release_ia32_bug.case
new file mode 100644 (file)
index 0000000..855fc0d
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>track bug 813 about raceback shows if i add a slash to release by accident</summary>
+  <tracking>
+    <ticket>803</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --release=tizen_20121223.1/ --logfile=mic.log
+grep "Finished" mic.log
+test -e ./mic-output/tizen_20121223.1/images/handset_blackbay*/platform.img
+test -e ./mic-output/tizen_20121223.1/images/handset_blackbay*/MD5SUMS
+test -e ./mic-output/tizen_20121223.1/images/handset_blackbay*/tizen_20121223.1_handset_blackbay.packages
+test -e ./mic-output/tizen_20121223.1/images/handset_blackbay*/tizen_20121223.1_handset_blackbay.ks
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e mic.log && sudo rm mic.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_repo_local_repo.case b/cases/create/mixed_cases/mic_cr_loop_repo_local_repo.case
new file mode 100644 (file)
index 0000000..f68695f
--- /dev/null
@@ -0,0 +1,43 @@
+<testcase>
+  <version>1.0</version>
+  <summary>test if mic can create image sucessfully if only local repo supplied</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="ks_files/handset_blackbay_localrepo_test.ks" />
+  </fixtures>
+  <tracking>
+    <ticket>512</ticket>
+  </tracking>
+  <steps><![CDATA[
+sudo umount /home/build/tmp/mic/cache || true
+sudo rm -rf /home/build/tmp/mic/cache
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=mic1.log
+grep "Finished" mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+pwd_dir=$(pwd)
+cd /home/build/tmp/mic/cache/packages/Tizen-base
+sudo createrepo .
+cd /home/build/tmp/mic/cache/packages/Tizen-main
+sudo createrepo .
+cd $pwd_dir
+sudo mic cr -d -v  loop handset_blackbay_localrepo_test.ks --repo "name=local-main;baseurl=file:///home/build/tmp/mic/cache/packages/Tizen-main/" --logfile=mic2.log -o out1
+grep "Finished" mic2.log
+test -e out1/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f mic1.log && sudo rm mic1.log
+test -f mic2.log && sudo rm mic2.log
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -e /home/build/tmp/mic/cache/packages/Tizen-base/repodata && sudo rm -rf /home/build/tmp/mic/cache/packages/Tizen-base/repodata
+test -e /home/build/tmp/mic/cache/packages/Tizen-main/repodata && sudo rm -rf /home/build/tmp/mic/cache/packages/Tizen-main/repodata
+test -d out1 && sudo rm -rf out1
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_without_conf_bootstrap_ia32.case b/cases/create/mixed_cases/mic_cr_loop_without_conf_bootstrap_ia32.case
new file mode 100644 (file)
index 0000000..369c848
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf, loop image cannot be created in bootstrap mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  loop handset_blackbay.ks --logfile=handset.log --runtime=bootstrap) 2>&1 | tee mic.log
+grep -i "Failed to download/install bootstrap package" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e handset.log && sudo rm handset.log
+test -e mic.log && sudo rm mic.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_without_conf_native_ia32.case b/cases/create/mixed_cases/mic_cr_loop_without_conf_native_ia32.case
new file mode 100644 (file)
index 0000000..a0e2d75
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf, loop image can be created in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=handset.log --runtime=native
+test -f handset.log
+grep 'Finished' handset.log
+test -e ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e handset.log && sudo rm handset.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_loop_without_var_lock.case b/cases/create/mixed_cases/mic_cr_loop_without_var_lock.case
new file mode 100644 (file)
index 0000000..9dfa85a
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>Reproduce bug 782, when /var/lock does not exist, Traceback shows when creating images.</summary>
+  <tracking>
+    <ticket>782</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+if [ test -d /var/lock ];then
+    sudo umount /var/lock  || true
+    sudo mv /var/lock /var/lock-bak
+fi
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=handset.log 2>&1 | tee all.log
+grep 'Finished' all.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d /var/lock-bak && sudo mv /var/lock-bak /var/lock
+test -d mic-output && sudo rm -rf mic-output
+test -e handset.log && sudo rm handset.log
+test -e all.log && sudo rm all.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_active_partition.case b/cases/create/mixed_cases/mic_cr_raw_active_partition.case
new file mode 100644 (file)
index 0000000..1304792
--- /dev/null
@@ -0,0 +1,37 @@
+<testcase>
+  <summary>This case is used to test if mic can work well with '--active' configed to partition in ks config file, the command is as bellow:
+            mic cr raw ./ks_files/ivi_with_active_partition.ks</summary>
+  <tracking>
+    <ticket>639</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/ivi_with_active_partition.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi_with_active_partition.ks --logfile=log.file
+test -e ./log.file
+grep "Finished" log.file
+raw_name=$(ls mic-output/ivi_with_active_partition-*-sdb.raw)
+test -f $raw_name
+kpartx_path=$(sudo which kpartx)
+sudo $kpartx_path -av $raw_name
+sleep 2
+blkid_path=$(sudo which blkid)
+blkid_output=$(sudo $blkid_path -L boot | sed 's/.*loop\([0-9]*\)p\([0-9]\)/\2/')
+parted_path=$(sudo which parted)
+parted_boot_output=$(sudo $parted_path  $raw_name print| grep 'boot' | awk '{print $1}')
+test  $blkid_output -eq $parted_boot_output
+sudo $kpartx_path -d $raw_name
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+test -f log.file && sudo rm log.file
+test -d mic-output && sudo rm -rf ./mic-output
+echo 'clean space finished...'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_broken_bootstrap.case b/cases/create/mixed_cases/mic_cr_raw_broken_bootstrap.case
new file mode 100644 (file)
index 0000000..8b5e971
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>Testing broken mic-bootstrap</summary>
+  <fixtures>
+    <copy src="ks_files/ivi_broken_content_bootstrap.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  raw ivi_broken_content_bootstrap.ks --logfile=mic.log)
+grep -i 'Failed to download/install bootstrap package or the package is in bad format' mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e mic.log && sudo rm mic.log
+test -e mic-output && sudo rm -rf mic-output
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_check-bootflag_gpt.case b/cases/create/mixed_cases/mic_cr_raw_check-bootflag_gpt.case
new file mode 100644 (file)
index 0000000..bab6752
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary></summary>
+  <fixtures>
+    <copy src="ks_files/ivi_with_active_partition_gpt.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi_with_active_partition_gpt.ks -d -v --runtime=native --logfile=handset.log
+test -f handset.log
+test -e ./mic-output/ivi_with_active_partition_gpt*.raw
+grep 'Finished' handset.log
+grep "Set 'legacy_boot' flag" handset.log
+Parted_path=$(sudo which parted)
+if man parted | grep "legacy_boot"
+then
+    sudo $Parted_path ./mic-output/ivi_with_active_partition_gpt*.raw print | grep "legacy_boot"
+fi
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -e handset.log && sudo rm handset.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_check-bootflag_mbr.case b/cases/create/mixed_cases/mic_cr_raw_check-bootflag_mbr.case
new file mode 100644 (file)
index 0000000..8a510ea
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary></summary>
+  <fixtures>
+    <copy src="ks_files/ivi_with_active_partition.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi_with_active_partition.ks --runtime=native --logfile=handset.log -d -v
+test -f handset.log
+grep 'Finished' handset.log
+test -e ./mic-output/ivi_with_active_partition*.raw
+grep "Set 'boot' flag" handset.log
+Parted_path=$(sudo which parted)
+if man parted | grep "boot"
+then
+    sudo $Parted_path ./mic-output/ivi_with_active_partition*.raw print | grep "boot"
+fi
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -e handset.log && sudo rm handset.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_duplicate_log_native.case b/cases/create/mixed_cases/mic_cr_raw_duplicate_log_native.case
new file mode 100644 (file)
index 0000000..9dbf939
--- /dev/null
@@ -0,0 +1,42 @@
+<testcase>
+  <summary>check whether the log generated by "--logfile" have duplicated package number</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi.ks --logfile=raw.log --runtime=native
+test -e raw.log
+grep -ao "Installing.*" raw.log > tmp1.log
+awk -F '  ' '{print $NF}' tmp1.log > tmp2.log
+grep -ao "\[.*\]" tmp2.log > tmp3.log
+#check whether it has duplicated adjacent lines
+if $(uniq -d tmp3.log | grep '.*')
+then
+    echo "Have duplicated adjacent lines"
+    exit 1
+fi
+Total_Pac=$(grep -ao "Packages: [0-9]* Total" raw.log | grep -ao "[0-9]*")
+#check whether it starts from "[1/*]"
+head -1 tmp3.log | grep "\[[[:space:]]*1\/$Total_Pac\]"
+#check whether it ends with "eg. [46/46]"
+tail -1 tmp3.log | grep "\[[[:space:]]*\($Total_Pac\)\/\1\]"
+#check whether the package number is sequential
+grep -ao "[0-9]*\/" tmp3.log > tmp4.log
+sed -i 's/\///' tmp4.log
+awk 'BEGIN{a=0} {if($1-a==1){a=$1}else{print"Not sequential";exit 1}}END{print "last number is:",a}' tmp4.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e mic-output && sudo rm -rf mic-output
+test -e tmp1.log && sudo rm tmp1.log
+test -e tmp2.log && sudo rm tmp2.log
+test -e tmp3.log && sudo rm tmp3.log
+test -e tmp4.log && sudo rm tmp4.log
+test -e raw.log && sudo rm raw.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_installerfw_extlinux.case b/cases/create/mixed_cases/mic_cr_raw_installerfw_extlinux.case
new file mode 100644 (file)
index 0000000..ca2a4fc
--- /dev/null
@@ -0,0 +1,46 @@
+<testcase>
+  <summary>This case is used to test if 'installerfw' command in ks</summary>
+  <fixtures>
+    <copy src="ks_files/ivi_with_installerfw.ks" />
+    <copy src="ks_files/ivi_syslinux_problem.ks" />
+  </fixtures>
+  <steps><![CDATA[
+platform=$(uname -m)
+distro=$(python -c "import platform;print platform.linux_distribution()[0].lower().rstrip()")
+if [ "$platform" == "x86_64" ] || [ "$distro" == "centos" ]
+then
+    losetup_path=$(sudo which losetup)
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+    sudo mic cr raw ivi_with_installerfw.ks -d -v --logfile=mic1.log
+    grep 'Finished' mic1.log
+    test -f ./mic-output/ivi_with_installerfw-*.raw
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+else
+    losetup_path=$(sudo which losetup)
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+    ! (sudo mic cr raw ivi_syslinux_problem.ks -d -v --logfile=log.file)
+    sudo test -e ./log.file
+    grep "Unable to install syslinux bootloader" log.file
+    sed -i '/password/ a installerfw_plugins "bootloader"' ivi_syslinux_problem.ks
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+    sudo mic cr raw ivi_syslinux_problem.ks  -d -v --logfile=new_log.file
+    sudo test -e ./new_log.file
+    grep "Finished" new_log.file
+    test -f ./mic-output/ivi_syslinux_problem-*.raw
+    sudo $losetup_path -a
+    sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+fi
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+test -f log.file && sudo rm log.file
+test -f new_log.file && sudo rm new_log.file
+test -d mic-output && sudo rm -rf ./mic-output
+echo 'clean space finished...'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_installerfw_fstab.case b/cases/create/mixed_cases/mic_cr_raw_installerfw_fstab.case
new file mode 100644 (file)
index 0000000..f02abd2
--- /dev/null
@@ -0,0 +1,61 @@
+<testcase>
+  <summary>This case is used to test if 'installerfw "fatab"' command in ks</summary>
+  <fixtures>
+    <copy src="ks_files/ivi_with_installerfw.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sed -i 's/installerfw_plugins "bootloader"/installerfw_plugins "fstab"/' ivi_with_installerfw.ks
+sudo mic cr -d -v  raw ivi_with_installerfw.ks --logfile=mic1.log --runtime=native
+grep 'Finished' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f ./mic-output/ivi_with_installerfw-*-sdb.raw
+raw_image=$(ls mic-output/ivi_with_installerfw-*-sdb.raw)
+sudo mkdir -p mic-output/ivi_dir/boot
+kpartx_path=$(sudo which kpartx)
+for i in {1..5}
+do
+    kpartx_output=$(sudo $kpartx_path -avs $raw_image)
+    if [ -n "$kpartx_output" ]; then
+        first_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '1p')
+        second_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '2p')
+        ls /dev/mapper/
+        if [ -n "$first_part" ] && [ -e "/dev/mapper/$first_part" ];then
+            sudo mount /dev/mapper/$first_part  mic-output/ivi_dir/boot/ -t ext3
+            sudo mount /dev/mapper/$second_part  mic-output/ivi_dir/ -t ext4
+            sudo chroot mic-output/ivi_dir/ echo 'chroot successfully'
+            ! (sudo chroot mic-output/ivi_dir/ test -f /etc/fstab)
+            exit 0
+        fi
+    fi
+    sleep 3
+done
+echo "can not get kpartx output: $kpartx_path -av $raw_image"
+exit 1
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+test -f mic1.log && sudo rm -f mic1.log
+raw_image=$(ls mic-output/ivi_with_installerfw-*-sdb.raw)
+if [ -f $raw_image ];then
+    for i in {1..5}
+    do
+    test -d mic-output/ivi_dir && sudo umount -l mic-output/ivi_dir
+    test -d mic-output/ivi_dir/boot && sudo umount -l mic-output/ivi_dir/boot
+    kpartx_path=$(sudo which kpartx)
+    sudo $kpartx_path -d $raw_image
+    if sudo losetup -a | grep "ivi_with_installerfw"; then
+        sleep 2
+    else
+        test -d mic-output && sudo rm -rf ./mic-output
+        break
+    fi
+    done
+fi
+sed -i 's/installerfw_plugins "fstab"/installerfw_plugins "bootloader"/' ./ks_files/ivi_with_installerfw.ks
+echo 'clean space finished...'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_invliad_mic-bootstrap.case b/cases/create/mixed_cases/mic_cr_raw_invliad_mic-bootstrap.case
new file mode 100644 (file)
index 0000000..858fd62
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>Testing invalid mic-bootstrap</summary>
+  <fixtures>
+    <copy src="ks_files/ivi_invalid_content_mic-bootstrap.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  raw ivi_invalid_content_mic-bootstrap.ks --logfile=mic.log)
+grep -i 'Failed to download/install bootstrap package or the package is in bad format' mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e mic.log && sudo rm mic.log
+test -e mic-output && sudo rm -rf mic-output
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_ivi_partition_size_compute_ia32.case b/cases/create/mixed_cases/mic_cr_raw_ivi_partition_size_compute_ia32.case
new file mode 100644 (file)
index 0000000..1b500c8
--- /dev/null
@@ -0,0 +1,45 @@
+<testcase>
+  <summary></summary>
+  <tracking>
+    <ticket>624</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/ivi_624.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+distro=`python -c "import platform;a=platform.linux_distribution();print a[0]"`
+sudo mic cr raw ivi_624.ks --logfile=./log/handset.log -d -v
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+test -e ./mic-output/ivi_624*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+if [ "$distro" == "CentOS" ]
+then
+    parted ./mic-output/ivi*.raw print | grep -o "Disk.*" >> tmp1.log
+    VAL1=$(awk '{print $NF}' tmp1.log | grep -o [0-9]*)
+    parted ./mic-output/ivi*.raw print >> tmp2.log
+    sed -i '/^$/d' tmp2.log
+    tail -1 tmp2.log >> tmp3.log
+    VAL2=$(awk '{print $3}' tmp3.log | grep -o [0-9]*)
+    test "$VAL1" -eq "$VAL2"
+else
+    fdisk_path=$(sudo which fdisk)
+    VAL1=`sudo $fdisk_path -l ./mic-output/ivi*.raw  | sed '/^$/d' |  sed -n '$p' | awk '{print $3}'`
+    sudo $fdisk_path -l ./mic-output/ivi*.raw | sed -n '/.*sectors$/p' >> tmp2.file
+    VAL2=`awk '{print $(NF-1)}' tmp2.file`
+    let VAL3=$VAL2-1
+    test "$VAL1" -eq "$VAL3"
+fi
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ./log/handset.log && sudo rm ./log/handset.log
+test -e tmp1.file && sudo rm tmp1.file
+test -e tmp2.file && sudo rm tmp2.file
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_locale.case b/cases/create/mixed_cases/mic_cr_raw_locale.case
new file mode 100644 (file)
index 0000000..6d07b15
--- /dev/null
@@ -0,0 +1,61 @@
+<testcase>
+  <summary>
+    test if '/etc/locale.conf' exists
+  </summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <tracking>
+    <ticket>1745</ticket>
+  </tracking>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi.ks --logfile=log.file -d -v
+grep "Finished" log.file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+raw_image=$(ls mic-output/ivi-*-sdb.raw)
+sudo mkdir -p mic-output/ivi_dir/boot
+kpartx_path=$(sudo which kpartx)
+for i in {1..5}
+do
+    kpartx_output=$(sudo $kpartx_path -av $raw_image)
+    if [ -n "$kpartx_output" ]; then
+        first_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '1p')
+        second_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '2p')
+        ls /dev/mapper/
+        if [ -n "$first_part" ] && [ -e "/dev/mapper/$first_part" ];then
+            sudo mount /dev/mapper/$first_part  mic-output/ivi_dir/boot/ -t ext4
+            sudo mount /dev/mapper/$second_part  mic-output/ivi_dir/ -t ext4
+            sudo chroot mic-output/ivi_dir/ test -f /etc/locale.conf
+            sudo chroot mic-output/ivi_dir/ cat  /etc/locale.conf | grep 'en_US.UTF-8'
+            exit 0
+        fi
+    fi
+    sleep 3
+done
+echo "can not get kpartx output: $kpartx_path -av $raw_image"
+exit 1
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo test -f log.file && sudo rm log.file
+raw_image=$(ls mic-output/ivi-*-sdb.raw)
+if [ -f $raw_image ]; then
+    for i in {1..5}; do
+      test -d mic-output/ivi_dir && sudo umount -l mic-output/ivi_dir
+      test -d mic-output/ivi_dir/boot && sudo umount -l mic-output/ivi_dir/boot
+      kpartx_path=$(sudo which kpartx)
+      sudo $kpartx_path -d $raw_image
+      if sudo losetup -a | grep "ivi"; then
+          sleep 2
+      else
+          test -d mic-output && sudo rm -rf ./mic-output
+          break
+      fi
+    done
+fi
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_multi_partition_gpt.case b/cases/create/mixed_cases/mic_cr_raw_multi_partition_gpt.case
new file mode 100644 (file)
index 0000000..49750e0
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>This case is used to test if mic can work well with multi partitions for GPT partition table format, which are setted in ks config file, the command is : mic cr raw ./ks_files/ivi_four_partition_gpt.ks</summary>
+  <tracking>
+    <ticket>741</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/ivi_four_partition_gpt.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi_four_partition_gpt.ks --logfile=log.file -d -v
+sudo test -e ./log.file
+grep "Finished" log.file
+sudo test -f ./mic-output/ivi_four_partition_gpt-*-sdb.raw
+raw_name=$(ls mic-output/ivi_four_partition_gpt-*-sdb.raw)
+parted_path=$(sudo which parted)
+sudo $parted_path  $raw_name print | grep "Partition Table: gpt"
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e log.file && sudo rm log.file
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_multi_partition_mbr.case b/cases/create/mixed_cases/mic_cr_raw_multi_partition_mbr.case
new file mode 100644 (file)
index 0000000..b5907da
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>This case is used to test if mic can work well with multi partitions for 'msdos' partition table format which are setted in ks config file, the command is as bellow: mic cr raw ./ks_files/ivi_four_partition_mbr.ks</summary>
+  <tracking>
+    <ticket>742</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/ivi_four_partition_mbr.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi_four_partition_mbr.ks --logfile=log.file -d -v
+test -e ./log.file
+grep "Finished" log.file
+test -f ./mic-output/ivi_four_partition_mbr-*-sdb.raw
+raw_name=$(ls ./mic-output/ivi_four_partition_mbr-*-sdb.raw)
+parted_path=$(sudo which parted)
+sudo $parted_path  $raw_name print | grep msdos
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e log.file && sudo rm log.file
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_no_mountpoint.case b/cases/create/mixed_cases/mic_cr_raw_no_mountpoint.case
new file mode 100644 (file)
index 0000000..7106d11
--- /dev/null
@@ -0,0 +1,22 @@
+<testcase>
+  <summary>Test the condition that the ks file has no mountpoint.</summary>
+  <fixtures>
+    <copy src="ks_files/ivi_no_mountpoint.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi_no_mountpoint.ks --logfile=./log/ivi.log
+test -f ./log/ivi.log
+grep 'Finished' ./log/ivi.log
+test -f ./mic-output/ivi*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo test -e ./mic-output && sudo rm -rf ./mic-output
+sudo test -e ./log/ivi.log && sudo rm ./log/ivi.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_no_partition.case b/cases/create/mixed_cases/mic_cr_raw_no_partition.case
new file mode 100644 (file)
index 0000000..2252900
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>This case is used to test if mic can work well with no partitions in ks config file,
+  the command is as bellow: mic cr raw ./ks_files/ivi_no_partition.ks</summary>
+  <fixtures>
+    <copy src="ks_files/ivi_no_partition.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi_no_partition.ks --logfile=log.file
+test -e ./log.file
+grep "Finished" log.file
+sudo test -f ./mic-output/ivi_no_partition-*-sda.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+test -d mic-output && sudo rm -rf ./mic-output
+test -f log.file && sudo rm log.file
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_prefix-conf_ia32.case b/cases/create/mixed_cases/mic_cr_raw_prefix-conf_ia32.case
new file mode 100644 (file)
index 0000000..7637b50
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>Test "name_prefix = prefix" in mic.conf</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+    <copy src="conf/mic_prefix.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi.ks --logfile=mic.log -c mic_prefix.conf -d -v
+test -f mic.log
+grep 'Finished' mic.log
+egrep 'mic [0-9]{1,2}\.[0-9]+' mic.log
+test -e ./mic-output/prefix-ivi*.raw
+test -e ./mic-output/prefix-ivi*.xml
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+test -e mic.log && sudo rm mic.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_proxy_in_ks_native.case b/cases/create/mixed_cases/mic_cr_raw_proxy_in_ks_native.case
new file mode 100644 (file)
index 0000000..d26894d
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <version>1.0</version>
+  <summary>This case is used to test if mic can create image successfully  with no proxy set in current shell, howerver it is set in ks file with '--proxy' for repo.</summary>
+  <fixtures>
+    <copy src="ks_files/ivi-mbr-i586-with-proxy.ks" />
+  </fixtures>
+  <tracking>
+    <ticket>66</ticket>
+  </tracking>
+  <steps><![CDATA[
+unset http_proxy || true
+unset https_proxy || true
+unset no_proxy || true
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi-mbr-i586-with-proxy.ks --logfile=log.file --runtime=native -d -v
+grep "Finished" log.file
+ls mic-output/ | grep 'ivi-mbr-i586-with-proxy-.*-sdb.raw'
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_release_record-pkgs_yum.case b/cases/create/mixed_cases/mic_cr_raw_release_record-pkgs_yum.case
new file mode 100644 (file)
index 0000000..5296465
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>test 'mic cr liveusb ks --release=xx --record-pkgs=xx' for liveusb type</summary>
+  <tracking>
+    <ticket>2081</ticket>
+  </tracking>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi.ks  --release=latest --record-pkgs=name --pkgmgr=yum
+grep "Finished" mic-output/latest/images/ivi/latest_ivi.log
+test -f mic-output/latest/images/ivi/latest_ivi*.raw
+test -f mic-output/latest/images/ivi/latest_ivi.log
+test -f mic-output/latest/images/ivi/latest_ivi.packages
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_unicode.case b/cases/create/mixed_cases/mic_cr_raw_unicode.case
new file mode 100644 (file)
index 0000000..9ebdcfc
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>create raw image when LANG is zh_CN.UTF-8</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+LANG=zh_CN.UTF-8
+sudo mic cr raw ivi.ks --logfile=mic1.log -d -v
+grep 'Finished' mic1.log
+test -f ./mic-output/ivi*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output/
+test -f mic1.log && sudo rm mic1.log
+echo 'finish cleaning...'
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_without_conf_bootstrap_ia32.case b/cases/create/mixed_cases/mic_cr_raw_without_conf_bootstrap_ia32.case
new file mode 100644 (file)
index 0000000..59fd6ad
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf, raw image cannot be created in bootstrap mode</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr loop ivi.ks --logfile=ivi.log --runtime=bootstrap -d -v) 2>&1 | tee mic.log
+grep -i "Failed to download/install bootstrap package" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ivi.log && sudo rm ivi.log
+test -e mic.log && sudo rm mic.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_raw_without_conf_native_ia32.case b/cases/create/mixed_cases/mic_cr_raw_without_conf_native_ia32.case
new file mode 100644 (file)
index 0000000..fe235cc
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>Without /etc/mic/mic.conf, raw image can be created in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -e /etc/mic/mic.conf
+sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+sudo mic cr raw ivi.ks --logfile=ivi.log --runtime=native -d -v
+test -f ivi.log
+grep 'Finished' ivi.log
+test -e ./mic-output/ivi*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ivi.log && sudo rm ivi.log
+test -e /etc/mic/mic.conf.bak && sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_cr_strict_mode_image.case b/cases/create/mixed_cases/mic_cr_strict_mode_image.case
new file mode 100644 (file)
index 0000000..b68a760
--- /dev/null
@@ -0,0 +1,40 @@
+<testcase>
+    <summary>Test option "--strict-mode", it this given, mic will abort creating image, if some rpm pagages fail to install</summary>
+    <fixtures>
+        <copy src="ks_files/strict_mode.ks" />
+        <copydir src="rpm/strict_mode_rpm" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+#create local repo
+mkdir -p /home/build/strict_mode/
+cp  ./strict_mode_rpm/*  /home/build/strict_mode/
+createrepo /home/build/strict_mode
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+#zypp pkg manager
+sudo mic cr -d -v loop strict_mode.ks --logfile=./log/handset.log
+grep 'Finished' ./log/handset.log
+#zypp pkg manager strict mode
+(! sudo mic cr -d -v loop strict_mode.ks --logfile=./log/handset.log --strict-mode)
+grep 'mic failes to install some packages' ./log/handset.log
+#yum pkg manager
+sudo mic cr -d -v loop strict_mode.ks --logfile=./log/handset.log --pkgmgr=yum --runtime=native
+grep 'Finished' ./log/handset.log
+#yum pkg magager strict mode
+(! sudo mic cr -d -v loop strict_mode.ks --logfile=./log/handset.log --strict-mode --pkgmgr=yum --runtime=native)
+grep 'mic failes to install some packages' ./log/handset.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+    ]]>
+ </steps>
+ <teardown>
+        <![CDATA[
+echo "cleaning..."
+sudo test -e ./mic-output && sudo rm -rf ./mic-output
+test -e ./log/handset.log && sudo rm ./log/handset.log
+test -e /home/build/strict_mode && sudo rm -rf /home/build/strict_mode
+        ]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_duplicate_log.case b/cases/create/mixed_cases/mic_duplicate_log.case
new file mode 100644 (file)
index 0000000..fbb9f30
--- /dev/null
@@ -0,0 +1,17 @@
+<testcase>
+  <summary>
+    testing if repeated log shows
+  </summary>
+  <fixtures>
+     <copy src="py_scripts/test_logging.py" />
+  </fixtures>
+  <steps><![CDATA[
+python test_logging.py  | grep hello | wc -l | xargs test 1 -eq
+python test_logging.py  | grep raw | wc -l | xargs test 1 -eq
+python test_logging.py  | grep imager | wc -l | xargs test 1 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/mixed_cases/mic_man_page.case b/cases/create/mixed_cases/mic_man_page.case
new file mode 100644 (file)
index 0000000..e0541bf
--- /dev/null
@@ -0,0 +1,6 @@
+<testcase>
+  <summary>check if man page exist for mic</summary>
+  <steps><![CDATA[
+man mic > /dev/null
+]]></steps>
+</testcase>
diff --git a/cases/create/neg_cases/mic_cr_failed_release_log.case b/cases/create/neg_cases/mic_cr_failed_release_log.case
new file mode 100644 (file)
index 0000000..3e642aa
--- /dev/null
@@ -0,0 +1,37 @@
+<testcase>
+  <summary>When image creation failed, the log generated by '--release' should also be located at release dir</summary>
+  <fixtures>
+    <copy src="ks_files/error_no_package.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v auto error_no_package.ks --release=tizen-2.0_20130311.2)
+sudo test -e mic-output/tizen-2.0_20130311.2/images/error_no_package/tizen-2.0_20130311.2_error_no_package.log
+! (grep -L "Finished" mic-output/tizen-2.0_20130311.2/images/error_no_package/tizen-2.0_20130311.2_error_no_package.log)
+ls mic-output/tizen-2.0_20130311.2/images/error_no_package | wc -l | xargs test 1 -eq
+
+# Add %packages part, then, image can be created successfully
+cat >>error_no_package.ks<<EOF
+%packages
+bash
+%end
+EOF
+
+sudo mic cr -d -v auto error_no_package.ks --release=tizen-2.0_20130311.2
+# At this time, dir 'mic-output/tizen-2.0_20130311.2/images/error_no_package' already exists, files under error_no_package
+# will be removed except *.log.
+sudo test -e mic-output/tizen-2.0_20130311.2/images/error_no_package/tizen-2.0_20130311.2_error_no_package.log
+ls mic-output/tizen-2.0_20130311.2/images/error_no_package | wc -l | xargs test 9 -eq
+grep "Finished" mic-output/tizen-2.0_20130311.2/images/error_no_package/tizen-2.0_20130311.2_error_no_package.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output
+sed -i '/^%packages/,$d' error_no_packages.ks
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/mic_cr_fs_no_mountpoint.case b/cases/create/neg_cases/mic_cr_fs_no_mountpoint.case
new file mode 100644 (file)
index 0000000..d3584e1
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>Test the condition that the ks file has no mountpoint.</summary>
+  <fixtures>
+     <copy src="ks_files/handset_blackbay_no_mountpoint.ks" />
+  </fixtures>
+  <steps>
+    <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay_no_mountpoint.ks --logfile=./log/handset.log
+test -f ./log/handset.log
+grep -i 'Finished' ./log/handset.log
+test -d ./mic-output/handset_blackbay_no_mountpoint*
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown>
+    <![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm ./log/handset.log
+]]>
+  </teardown>
+</testcase>
diff --git a/cases/create/neg_cases/mic_cr_loop_compress-image_wrong-format.case b/cases/create/neg_cases/mic_cr_loop_compress-image_wrong-format.case
new file mode 100644 (file)
index 0000000..c96e1ae
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>create loop image with ia32 arch and compress-image option with bz2</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --compress-image=az4 -o out2 --logfile=mic2.log 2>&1 | tee mic.log || true
+grep -i "invalid choice.*az4.*" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/
+sudo rm -f mic2.log mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_command_without_ks_file.case b/cases/create/neg_cases/negative_command_without_ks_file.case
new file mode 100644 (file)
index 0000000..1341f4a
--- /dev/null
@@ -0,0 +1,17 @@
+<testcase>
+  <summary>create fs image without ks file</summary>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs >> mic1.log
+grep -i 'mic create(cr).*[OPTS]' mic1.log 
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+
+sudo rm mic1.log
+
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_error-ks-with-chinese.case b/cases/create/neg_cases/negative_error-ks-with-chinese.case
new file mode 100644 (file)
index 0000000..ae47f89
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testcase>
+  <summary>create loop image with a ks with Chinese character in it</summary>
+  <fixtures>
+    <copy src="ks_files/error_ks_with_chinese.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+export LC_ALL=zh_CN.utf-8
+(! sudo mic cr -d -v  auto error_ks_with_chinese.ks --logfile=mic1.log)
+grep -i 'Unable to find package: ä½ å¥½' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_error-package-ks.case b/cases/create/neg_cases/negative_error-package-ks.case
new file mode 100644 (file)
index 0000000..b1b459a
--- /dev/null
@@ -0,0 +1,20 @@
+<testcase>
+  <summary>create image with ks file use error package like named 'svn'</summary>
+  <fixtures>
+    <copy src="ks_files/error_package.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  auto error_package.ks --logfile=mic1.log)
+grep -i 'Unable to find package: svn' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_error-repo-ks.case b/cases/create/neg_cases/negative_error-repo-ks.case
new file mode 100644 (file)
index 0000000..634506e
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>create image with error repo or no exsit repo</summary>
+  <fixtures>
+    <copy src="ks_files/error_repo.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  auto error_repo.ks --logfile=mic1.log )
+grep 'URLGrabber error' mic1.log || \
+  grep 'PYCURL ERROR' mic1.log || \
+  grep 'HTTP Error' mic1.log  || \
+  grep '404 Not Found' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_error_proxy_conf.case b/cases/create/neg_cases/negative_error_proxy_conf.case
new file mode 100644 (file)
index 0000000..189a1ed
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>create loop image with custom mic conf, in which the proxy is wrong</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic_error.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  loop handset_blackbay.ks -c mic_error.conf 2>&1 | tee mic1.log)
+grep -i "[URLGrabber error|PYCURL ERROR|HTTP Error|couldn't connect]" mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_error_proxy_conf_logfile.case b/cases/create/neg_cases/negative_error_proxy_conf_logfile.case
new file mode 100644 (file)
index 0000000..696b2f5
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>
+  create loop image with custom mic conf and log file,
+  in which the proxy is wrong
+  </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic_error.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  loop handset_blackbay.ks -c mic_error.conf --logfile=error.log)
+grep -i "[URLGrabber error|PYCURL ERROR|HTTP Error|couldn't connect]" error.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+sudo rm error.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_mic_cr_auto_without_autoline.case b/cases/create/neg_cases/negative_mic_cr_auto_without_autoline.case
new file mode 100644 (file)
index 0000000..a389f98
--- /dev/null
@@ -0,0 +1,20 @@
+<testcase>
+  <summary>create auto image with a ks without the fist auto line</summary>
+  <fixtures>
+    <copy src="ks_files/error_auto.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  auto error_auto.ks --logfile=mic1.log)
+grep -i 'Invalid magic line in file' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_no-package-ks.case b/cases/create/neg_cases/negative_no-package-ks.case
new file mode 100644 (file)
index 0000000..7303a89
--- /dev/null
@@ -0,0 +1,20 @@
+<testcase>
+  <summary>create loop image with a ks with no package in it</summary>
+  <fixtures>
+    <copy src="ks_files/error_no_package.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  loop error_no_package.ks --logfile=mic1.log)
+grep -i 'No packages or groups specified' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_no-repo-ks.case b/cases/create/neg_cases/negative_no-repo-ks.case
new file mode 100644 (file)
index 0000000..53c1c5a
--- /dev/null
@@ -0,0 +1,20 @@
+<testcase>
+  <summary>create loop image with a ks with no repo in it</summary>
+  <fixtures>
+    <copy src="ks_files/error_no_repo.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+(! sudo mic cr -d -v  loop error_no_repo.ks --logfile=mic1.log)
+grep -i 'no valid repos found in ks file' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/neg_cases/negative_non-existed-package.case b/cases/create/neg_cases/negative_non-existed-package.case
new file mode 100644 (file)
index 0000000..50de88d
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>when the ks includes a non-existed package,mic exit.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sed -i '/\%packages/a\hellokitty' handset_blackbay.ks
+(! sudo mic cr -d -v  auto handset_blackbay.ks --logfile=mic1.log)
+grep -i "Unable to find package: hellokitty" mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "clean space...."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_auto_liveusb.case b/cases/create/opt_cases/mic_cr_auto_liveusb.case
new file mode 100644 (file)
index 0000000..8f404ed
--- /dev/null
@@ -0,0 +1,43 @@
+<testcase>
+  <summary>test 'mic cr auto ks' for liveusb type
+if we run command with 'auto', mic will use the first line in ks file, which called magic line, and
+magic line in this ks file is:
+ -*-mic2-options-*- -f liveusb --copy-kernel --pack-to=@NAME@-rs.zip -*-mic2-options-*-</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+    <content target="parse_manifest.py">
+import sys
+import json
+img_file = sys.argv[1]
+mic_version = sys.argv[2]
+manifest_file=open('mic-output/manifest.json')
+manifest=json.load(manifest_file)
+assert manifest['format'] == 'liveusb'
+assert manifest['version'] == mic_version
+assert manifest['liveusb']['pack'] == '.zip'
+assert img_file in manifest['liveusb']['image_files']
+    </content>
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  auto gnome-live.ks --logfile=log.file --runtime=native
+grep "Finished" log.file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+liveusb_img=$(ls mic-output/ | grep 'gnome-live-.*-rs.zip')
+ls mic-output/ | grep 'gnome-live-.*-vmlinuz-.*'
+mic_version=$(mic --version | awk '{print $2}')
+python parse_manifest.py $liveusb_img $mic_version
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_include-src_ia32.case b/cases/create/opt_cases/mic_cr_fs_include-src_ia32.case
new file mode 100644 (file)
index 0000000..5a9df02
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+    <summary>create fs image with ia32 arch and --include-src option</summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay.ks" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --include-src  --logfile=mic1.log
+grep 'Finished' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -d ./mic-output/handset_blackbay*
+sudo chroot ./mic-output/handset_blackbay* ls /usr/src/SRPMS/ | grep ".*\.rpm"
+        ]]>
+    </steps>
+    <teardown>
+        <![CDATA[
+echo "cleaning..."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+        ]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_include-src_native_ia32.case b/cases/create/opt_cases/mic_cr_fs_include-src_native_ia32.case
new file mode 100644 (file)
index 0000000..3593ad1
--- /dev/null
@@ -0,0 +1,22 @@
+<testcase>
+  <summary>create fs image with ia32 arch and --include-src option</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --include-src --runtime=native --logfile=mic1.log
+grep 'Finished' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -d ./mic-output/handset_blackbay*
+sudo chroot ./mic-output/handset_blackbay* ls /usr/src/SRPMS/ | grep ".*\.rpm"
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_pack-to-tar-bz2_native_ia32.case b/cases/create/opt_cases/mic_cr_fs_pack-to-tar-bz2_native_ia32.case
new file mode 100644 (file)
index 0000000..1988585
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>create fs image with arch ia32 and --pack-to is .tar.bz2 in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --pack-to=@NAME@.tar.bz2 --runtime=native --logfile=mic.log
+(! grep -i 'Start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+tar_name=$(ls mic-output/handset_blackbay-*.tar.bz2)
+test -f $tar_name
+sudo tar -xvf $tar_name -C mic-output/
+test -d mic-output/bin
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_pack-to-tar-gz_native_ia32.case b/cases/create/opt_cases/mic_cr_fs_pack-to-tar-gz_native_ia32.case
new file mode 100644 (file)
index 0000000..9678b69
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>create fs image with arch ia32 and --pack-to is .tar.gz in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --pack-to=@NAME@.tar.gz --runtime=native --logfile=mic.log
+(! grep -i 'Start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+tar_name=$(ls mic-output/handset_blackbay-*.tar.gz)
+test -f $tar_name
+sudo tar -zxf $tar_name -C mic-output/
+test -d mic-output/bin
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_pack-to-tar_native_ia32.case b/cases/create/opt_cases/mic_cr_fs_pack-to-tar_native_ia32.case
new file mode 100644 (file)
index 0000000..d4f5045
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>create fs image with arch ia32 and --pack-to is .tar in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --pack-to=@NAME@.tar --runtime=native --logfile=mic.log
+(! grep -i 'Start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+tar_name=$(ls mic-output/handset_blackbay-*.tar)
+test -f $tar_name
+sudo tar -xvf $tar_name -C mic-output/
+test -d mic-output/bin
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_pack-to-tbz_native_ia32.case b/cases/create/opt_cases/mic_cr_fs_pack-to-tbz_native_ia32.case
new file mode 100644 (file)
index 0000000..2696ff0
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>create fs image with arch ia32 and --pack-to is .tbz in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --pack-to=@NAME@.tbz --runtime=native --logfile=mic.log
+(! grep -i 'Start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+tar_name=$(ls mic-output/handset_blackbay-*.tbz)
+test -f $tar_name
+sudo tar -xvf $tar_name -C mic-output/
+test -d mic-output/bin
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_pack-to-tgz_native_ia32.case b/cases/create/opt_cases/mic_cr_fs_pack-to-tgz_native_ia32.case
new file mode 100644 (file)
index 0000000..27eefe9
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>create fs image with arch ia32 and --pack-to is .tgz in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --pack-to=@NAME@.tgz --runtime=native --logfile=mic.log
+(! grep -i 'Start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+tar_name=$(ls mic-output/handset_blackbay-*.tgz)
+test -f $tar_name
+sudo tar -xvf $tar_name -C mic-output/
+test -d mic-output/bin
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_record-pkgs-name-content-license-vcs_ia32.case b/cases/create/opt_cases/mic_cr_fs_record-pkgs-name-content-license-vcs_ia32.case
new file mode 100644 (file)
index 0000000..2ad3b7f
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+    <summary>create loop image with ia32 arch and --record-pkgs is name, content, license, vcs</summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay.ks" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --record-pkgs=name,content,license,vcs  --logfile=mic.log
+grep 'Finished' mic.log
+test -d ./mic-output/handset_blackbay*[0-9]
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+cat ./mic-output/handset_blackbay*.packages | grep bash
+cat ./mic-output/handset_blackbay*.license | grep bash
+cat ./mic-output/handset_blackbay*.files | grep bash
+        ]]>
+    </steps>
+    <teardown>
+        <![CDATA[
+echo "cleaning...."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning...."
+        ]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_record-pkgs-name-content-license-vcs_native_ia32.case b/cases/create/opt_cases/mic_cr_fs_record-pkgs-name-content-license-vcs_native_ia32.case
new file mode 100644 (file)
index 0000000..034b503
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>create loop image with ia32 arch and --record-pkgs is name, content, license, vcs</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks \
+  --record-pkgs=name,content,license,vcs \
+  --runtime=native \
+  --logfile=mic.log
+grep 'Finished' mic.log
+test -d ./mic-output/handset_blackbay*[0-9]
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+cat ./mic-output/handset_blackbay*.packages | grep bash
+cat ./mic-output/handset_blackbay*.license | grep bash
+cat ./mic-output/handset_blackbay*.files | grep bash
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning...."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning...."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_runtime-bootstrap_ia32.case b/cases/create/opt_cases/mic_cr_fs_runtime-bootstrap_ia32.case
new file mode 100644 (file)
index 0000000..ff65077
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+    <summary>create fs image with ia32 arch and --runtime is bootstrap</summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay.ks" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --runtime=bootstrap  --logfile=mic.log
+grep 'Start mic in bootstrap' mic.log
+grep 'Finished' mic.log
+image_name=`ls ./mic-output | grep 'handset_blackbay*'`
+test -d ./mic-output/$image_name
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+        ]]>
+    </steps>
+    <teardown>
+        <![CDATA[
+echo "cleaning..."
+sudo rm mic.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+        ]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_fs_runtime-native_ia32.case b/cases/create/opt_cases/mic_cr_fs_runtime-native_ia32.case
new file mode 100644 (file)
index 0000000..9f0755f
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>create fs image with ia32 arch and --runtime is native</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --runtime=native --logfile=mic.log
+(! grep -i 'Start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+image_name=`ls ./mic-output | grep 'handset_blackbay'`
+test -d ./mic-output/$image_name
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_livecd.case b/cases/create/opt_cases/mic_cr_livecd.case
new file mode 100644 (file)
index 0000000..5e703e6
--- /dev/null
@@ -0,0 +1,41 @@
+<testcase>
+  <summary>create livecd  image with ia32 arch</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+    <content target="parse_manifest.py">
+import sys
+import json
+img_file = sys.argv[1]
+mic_version = sys.argv[2]
+manifest_file=open('mic-output/manifest.json')
+manifest=json.load(manifest_file)
+assert manifest['format'] == 'livecd'
+assert manifest['version'] == mic_version
+assert img_file in manifest['livecd']['image_files']
+    </content>
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  livecd gnome-live.ks --runtime=native 2>&1 | tee mic1.log
+grep 'Finished' mic1.log
+test -f ./mic-output/gnome-live-*.iso
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+img_file=$(ls mic-output | grep gnome-live-.*.iso)
+mic_version=$(mic --version | awk '{print $2}')
+python parse_manifest.py $img_file $mic_version
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf mic-output/
+sudo rm mic1.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_liveusb.case b/cases/create/opt_cases/mic_cr_liveusb.case
new file mode 100644 (file)
index 0000000..f4f7a06
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>create liveusb  image with ia32 arch</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  liveusb gnome-live.ks --runtime=native 2>&1 | tee mic1.log
+grep 'Finished' mic1.log
+test -f ./mic-output/gnome-live-*.usbimg
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf mic-output/
+sudo rm mic1.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_liveusb_copy-kernel_native_ia32.case b/cases/create/opt_cases/mic_cr_liveusb_copy-kernel_native_ia32.case
new file mode 100644 (file)
index 0000000..a22448a
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>mic create liveusb image with ia32 arch and --copy-kernel in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  liveusb gnome-live.ks --copy-kernel --logfile=mic.log --runtime=native
+grep 'Finished' mic.log
+test -f ./mic-output/gnome-live-*.usbimg
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+ls -l ./mic-output | grep -E 'gnome-live-.*-vmlinuz.*'
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm -rf mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_liveusb_pack-to-tar-gz_native.case b/cases/create/opt_cases/mic_cr_liveusb_pack-to-tar-gz_native.case
new file mode 100644 (file)
index 0000000..d644ba4
--- /dev/null
@@ -0,0 +1,31 @@
+<testcase>
+  <summary>create live image and --pack-to is .tar.gz in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <conditions>
+   <blacklist>
+    <platform>ubuntu14.10</platform>
+   </blacklist>
+  </conditions>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  liveusb gnome-live.ks --pack-to=@NAME@.tar.gz --runtime=native --logfile=mic.log
+(! grep -i 'Start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+gnome_name=$(ls ./mic-output/gnome-live-*.tar.gz)
+test -f $gnome_name
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo tar -xf $gnome_name -C mic-output
+test -e mic-output/gnome-live-*.usbimg
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_arc-invalid_ia32.case b/cases/create/opt_cases/mic_cr_loop_arc-invalid_ia32.case
new file mode 100644 (file)
index 0000000..1a1fbe3
--- /dev/null
@@ -0,0 +1,20 @@
+<testcase>
+  <summary>This test case is used to test the option "-A",in this case,it is set to i268 which is wrong, the result should fail.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  loop handset_blackbay.ks -A i286 --logfile=mic1.log)
+grep "Invalid architecture" mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic1.log
+sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_arc_ia32.case b/cases/create/opt_cases/mic_cr_loop_arc_ia32.case
new file mode 100644 (file)
index 0000000..b90f600
--- /dev/null
@@ -0,0 +1,22 @@
+<testcase>
+  <summary>This test case is used to test the option "-A",in this case,it is set to i686 as for handset_blackbay.ks.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -A i686 --logfile=log.file
+grep "Finished" log.file
+test -e ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm log.file
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_arch-vague_ia32.case b/cases/create/opt_cases/mic_cr_loop_arch-vague_ia32.case
new file mode 100644 (file)
index 0000000..598f696
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>create loop image with @ARCH@ is ks file, and run command with -A armv7l</summary>
+  <fixtures>
+    <copy src="ks_files/armv7l_with_arch.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+enforce_path=$(sudo which setenforce || true)
+if [ ! -z $enforce_path ];then
+    sudo $enforce_path 0 || true
+fi
+sudo mic cr -d -v  loop armv7l_with_arch.ks -A armv7l -o out1 --logfile=mic1.log
+grep 'Finished' mic1.log
+grep 'armv7l' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f ./out1/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/
+sudo rm mic1.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_cache-current-dir_ia32.case b/cases/create/opt_cases/mic_cr_loop_cache-current-dir_ia32.case
new file mode 100644 (file)
index 0000000..e542fa0
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>This test case is used to test the option "-k", which should be set to a directory.
+ In this test case, the given value of this option is correct,so the result should be correspondently right.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --cachedir=./cache/mic_cache --logfile=file.log
+grep 'Finished' file.log
+test -f ./mic-output/platform.img
+test -d ./cache/mic_cache
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm file.log
+sudo rm -rf mic-output ./cache/mic_cache
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_cache-current-dir_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_cache-current-dir_native_ia32.case
new file mode 100644 (file)
index 0000000..d5759e1
--- /dev/null
@@ -0,0 +1,41 @@
+<testcase>
+  <summary>This test case is used to test the option "-k", which should be set to a directory, and  when run the same command more then one times, it should use the cached download packages instead of downloading again unless you specified '--nocache' for repos in kickstart files. In this case we tested the case when cache directory is in the current direcroty, 'yum' as backend, and native mode.
+
+And if run the same ks with the same cache, it shouldn't download packages again</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --cachedir=./cache/mic_cache \
+  --runtime=native \
+  --logfile=file.log
+grep 'Finished' file.log
+grep "43 Total, 0 Cached, 43 Missed" file.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -d ./cache/mic_cache
+test -f ./mic-output/platform.img
+sudo rm -rf mic-output
+sudo rm -f file.log
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --cachedir=./cache/mic_cache \
+  --runtime=native \
+  --pkgmgr=yum \
+  --logfile=file.log
+grep 'Finished' file.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep "43 Total, 43 Cached, 0 Missed" file.log
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm file.log
+sudo rm -rf mic-output ./cache/mic_cache
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_cache-root-dir_ia32.case b/cases/create/opt_cases/mic_cr_loop_cache-root-dir_ia32.case
new file mode 100644 (file)
index 0000000..4a00b5b
--- /dev/null
@@ -0,0 +1,40 @@
+<testcase>
+  <summary>
+  This test case is used to test the option "-k", which should be set to a
+  directory, and  when run the same command more then one times, it should
+  use the cached download packages instead of downloading again unless you
+  specified '--nocache' for repos in kickstart files. In this case we tested
+  the case when cache directory is specified to root direcroty(because mic
+  forgot to mount cache directory in bootstrap mode before), 'zypp' as
+  backend, and bootstrap mode
+  </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -k /root/cache/mic_cache --logfile=file.log
+grep 'Finished' file.log
+grep "43 Total, 0 Cached, 43 Missed" file.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo test -d /root/cache/mic_cache
+test -f ./mic-output/platform.img
+sudo rm -rf file.log
+sudo rm -rf mic-output
+sudo mic cr -d -v  loop handset_blackbay.ks -k /root/cache/mic_cache --logfile=file.log
+grep 'Finished' file.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep "43 Total, 43 Cached, 0 Missed" file.log
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm file.log
+sudo rm -rf mic-output  /root/cache/mic_cache
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_cache-root-dir_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_cache-root-dir_native_ia32.case
new file mode 100644 (file)
index 0000000..2b09f63
--- /dev/null
@@ -0,0 +1,45 @@
+<testcase>
+  <summary>
+  This test case is used to test the option "-k", which should be set to a
+  directory, and  when run the same command more then one times, it should
+  use the cached download packages instead of downloading again unless you
+  specified '--nocache' for repos in kickstart files. In this case we tested
+  the case when cache directory  is specified to root direcroty(because mic
+  forgot to mount cache directory in bootstrap mode before), 'zypp' as
+  backend, and native mode
+  </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -k /root/cache/mic_cache \
+  --runtime=native \
+  --logfile=file.log
+grep 'Finished' file.log
+grep "43 Total, 0 Cached, 43 Missed" file.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo test -d /root/cache/mic_cache
+test -f ./mic-output/platform.img
+sudo rm -rf file.log
+sudo rm -rf mic-output
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  -k /root/cache/mic_cache \
+  --runtime=native \
+  --pkgmgr=zypp \
+  --logfile=file.log
+grep 'Finished' file.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep "43 Total, 43 Cached, 0 Missed" file.log
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm file.log
+sudo rm -rf mic-output  /root/cache/mic_cache
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_compress-image-bz2_ia32.case b/cases/create/opt_cases/mic_cr_loop_compress-image-bz2_ia32.case
new file mode 100644 (file)
index 0000000..0898809
--- /dev/null
@@ -0,0 +1,36 @@
+<testcase>
+  <summary>create loop image with ia32 arch and compress-image option with bz2</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="scripts/compute_volume.sh" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -o out1 --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./out1/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --compress-image=bz2 -o out2 --logfile=mic2.log
+grep 'Finished' mic2.log
+test -f ./out2/platform.img.bz2
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+source compute_volume.sh
+p1=`compute_volume ./out1/platform.img`
+p2=`compute_volume ./out2/platform.img.bz2`
+result=`awk -v before_volume=$p1 -v cpmpress_volume=$p2 'BEGIN {print(before_volume>cpmpress_volume)?"yes":"no"}'`
+test $result = 'yes'
+cd out2
+sudo bunzip2 platform.img.bz2
+test -f platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/ ./out2/
+sudo rm mic1.log mic2.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_compress-image-gz_ia32.case b/cases/create/opt_cases/mic_cr_loop_compress-image-gz_ia32.case
new file mode 100644 (file)
index 0000000..e016021
--- /dev/null
@@ -0,0 +1,36 @@
+<testcase>
+  <summary>create loop image with ia32 arch and compress-image option with gz</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="scripts/compute_volume.sh" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -o out1 --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./out1/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --compress-image=gz -o out2 --logfile=mic2.log
+grep 'Finished' mic2.log
+test -f ./out2/platform.img.gz
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+source compute_volume.sh
+p1=`compute_volume ./out1/platform.img`
+p2=`compute_volume ./out2/platform.img.gz`
+result=`awk -v before_volume=$p1 -v cpmpress_volume=$p2 'BEGIN {print(before_volume>cpmpress_volume)?"yes":"no"}'`
+test $result = 'yes'
+cd out2
+sudo gunzip platform.img.gz
+test -f platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/ ./out2/
+sudo rm mic1.log mic2.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_compress-image-invalid_ia32.case b/cases/create/opt_cases/mic_cr_loop_compress-image-invalid_ia32.case
new file mode 100644 (file)
index 0000000..3dbe3ab
--- /dev/null
@@ -0,0 +1,20 @@
+<testcase>
+  <summary>create loop image with ia32 arch and compress-image option with invalid option, like zip</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  loop handset_blackbay.ks --compress-image=zip  2>&1 | tee mic2.log)
+grep -E "compress-image: invalid choice: 'zip'" mic2.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm -f mic2.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_compress-image-lzo_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_compress-image-lzo_native_ia32.case
new file mode 100644 (file)
index 0000000..eb3b5d5
--- /dev/null
@@ -0,0 +1,36 @@
+<testcase>
+  <summary>create loop image with ia32 arch and compress-image option with lzo</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="scripts/compute_volume.sh" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+if ! which lzop; then
+    sudo spm install lzop
+fi
+sudo mic cr -d -v  loop handset_blackbay.ks -o out1 --logfile=mic1.log --runtime=native
+grep 'Finished' mic1.log
+test -e ./out1/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --compress-image=lzo -o out2 --logfile=mic2.log --runtime=native
+grep 'Finished' mic2.log
+test -e ./out2/platform.img.lzo
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+source compute_volume.sh
+p1=`compute_volume ./out1/platform.img`
+p2=`compute_volume ./out2/platform.img.lzo`
+result=`awk -v before_volume=$p1 -v compress_volume=$p2 'BEGIN {print(before_volume>compress_volume)?"yes":"no"}'`
+test $result = 'yes'
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/ ./out2/
+sudo rm mic1.log mic2.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_conf_ia32.case b/cases/create/opt_cases/mic_cr_loop_conf_ia32.case
new file mode 100644 (file)
index 0000000..a006fa3
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>This test case is used to test the option "--config",
+ a mic config file name is given to this option,the image will created according to the configurations that is set in the file mic.conf.
+ In this test case, the 'mic.conf' is copied from the default mic.conf which locates at "/etc/mic/" with modifying the "--outdir".</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -c mic.conf --logfile=log.file
+grep "Finished" log.file
+test -f ./my_mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm log.file
+sudo rm -rf ./my_mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_conf_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_conf_native_ia32.case
new file mode 100644 (file)
index 0000000..6a47e30
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>This test case is used to test the option "--config",
+ a mic config file name is given to this option,the image will created according to the configurations that is set in the file mic.conf.
+ In this test case, the 'mic.conf' is copied from the default mic.conf which locates at "/etc/mic/" with modifying the "runtime=native".</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic_native.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -c mic_native.conf --logfile=log.file
+grep "Finished" log.file
+(! grep -i 'start mic in bootstrap' log.file)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d ./mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_copy-kernel_ia32.case b/cases/create/opt_cases/mic_cr_loop_copy-kernel_ia32.case
new file mode 100644 (file)
index 0000000..32ff428
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>mic create loop image with ia32 arch and --copy-kernel</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --copy-kernel --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+ls -l ./mic-output | grep -E 'handset_blackbay.*vm.*'
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm -rf mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_debug_ia32.case b/cases/create/opt_cases/mic_cr_loop_debug_ia32.case
new file mode 100644 (file)
index 0000000..1951c52
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>create loop image with armv7l arch and -d -v option</summary>
+  <fixtures>
+    <copy src="ks_files/armv7l.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+enforce_path=$(sudo which setenforce || true)
+if [ ! -z $enforce_path ];then
+    sudo $enforce_path 0 || true
+fi
+sudo mic cr loop armv7l.ks -d -v  -o out1  2>&1 | tee mic1.log
+grep -i 'Finished' mic1.log
+grep -i 'Debug' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+grep -i 'Verbose' mic1.log
+test -f ./out1/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/
+sudo rm mic1.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_interactive_ia32.case b/cases/create/opt_cases/mic_cr_loop_interactive_ia32.case
new file mode 100644 (file)
index 0000000..0893498
--- /dev/null
@@ -0,0 +1,30 @@
+<testcase>
+  <summary>Test option "--interactive" ,"--non-interactive"</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sed -i '/shadow-utils/d' handset_blackbay.ks
+sudo mic --non-interactive cr loop handset_blackbay.ks 
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+bash -c "sudo mic -i cr loop handset_blackbay.ks 2>&1 >> tmp.log" << EOF
+n
+EOF
+grep ".* \[y/n](y): INFO" tmp.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d mic-output && sudo rm -rf ./mic-output
+test -d test-output && sudo rm -rf ./test-output
+test -e tmp.log && sudo rm tmp.log
+sed -i '/%packages/a\shadow-utils' ./ks_files/handset_blackbay.ks
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_local-pkg-path_ia32.case b/cases/create/opt_cases/mic_cr_loop_local-pkg-path_ia32.case
new file mode 100644 (file)
index 0000000..2f01a1c
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+    <summary>Test "--local-pkg-path".</summary>
+    <fixtures>
+        <copy src="ks_files/handset_blackbay.ks" />
+        <copydir src="rpm" />
+    </fixtures>
+    <steps>
+        <![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --local-pkgs-path=./rpm --logfile=./log/handset.log
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+test -e ./mic-output/handset_blackbay*[0-9]
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo chroot ./mic-output/handset_blackbay*[0-9] rpm -qa | grep "sed"
+        ]]>
+    </steps>
+    <teardown>
+        <![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm ./log/handset.log
+echo "finish cleaning..."
+        ]]>
+    </teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_local-pkg-path_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_local-pkg-path_native_ia32.case
new file mode 100644 (file)
index 0000000..0c0e80a
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>Test "--local-pkg-path".</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copydir src="rpm" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  fs handset_blackbay.ks --local-pkgs-path=./rpm --runtime=native --logfile=./log/handset.log
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+test -e ./mic-output/handset_blackbay*[0-9]
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo chroot ./mic-output/handset_blackbay*[0-9] rpm -qa | grep "sed"
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm ./log/handset.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_logfile-current-dir_ia32.case b/cases/create/opt_cases/mic_cr_loop_logfile-current-dir_ia32.case
new file mode 100644 (file)
index 0000000..3684e50
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>
+  This is a negative test, which is used to test the option "--logfile", this
+  option should be set to a file name, in this test case, we set it to a
+  directory name , so error info "Error usage:logfile.* path ./log_dir should
+  be file,please use .* for more info" should turn up.
+  </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+hostname=$(hostname)
+mkdir ./log_dir
+! (sudo mic cr -d -v  loop handset_blackbay.ks --logfile=./log_dir 2>&1 | tee  mic.log )
+grep -i "./log_dir should be file"  mic.log
+grep "$hostname" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm -rf mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_logfile-current-file_ia32.case b/cases/create/opt_cases/mic_cr_loop_logfile-current-file_ia32.case
new file mode 100644 (file)
index 0000000..b390a84
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>This test case is used to test the option "--logfile",
+if a file name is given to it, images should be created successfully.
+There is no need to give an existed file name, mic will create a new file with the given name if the file does not exist currently.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+hostname=$(hostname)
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=./log/handset.log
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+grep "$hostname" ./log/handset.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+egrep 'mic [0-9]{1,2}\.[0-9]+' ./log/handset.log
+test -f ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm ./log/handset.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_logfile-current-file_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_logfile-current-file_native_ia32.case
new file mode 100644 (file)
index 0000000..3f43127
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>This test case is used to test the option "--logfile",
+if a file name is given to it, images should be created successfully.
+There is no need to give an existed file name, mic will create a new file with the given name if the file does not exist at present.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+hostname=$(hostname)
+sudo mic cr -d -v  loop handset_blackbay.ks --runtime=native --logfile=./log/handset.log
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+grep "$(hostname)" ./log/handset.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+egrep 'mic [0-9]{1,2}\.[0-9]+' ./log/handset.log
+test -f ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm ./log/handset.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_logfile-root-file_ia32.case b/cases/create/opt_cases/mic_cr_loop_logfile-root-file_ia32.case
new file mode 100644 (file)
index 0000000..9589c5f
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <summary>Test "--logfile" option.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+hostname=$(hostname)
+sudo mic cr -d -v  loop handset_blackbay.ks --logfile=/root/log_file  >> mic.log
+grep "Finished" mic.log
+sudo test -e /root/log_file
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo egrep "$hostname" /root/log_file
+sudo egrep 'mic [0-9]{1,2}\.[0-9]+' /root/log_file
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm  /root/log_file  mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_outdir-current-dir_ia32.case b/cases/create/opt_cases/mic_cr_loop_outdir-current-dir_ia32.case
new file mode 100644 (file)
index 0000000..53e902e
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>This test case is used to test the option "--outdir",
+it can be set to an existed directory and also can be set to an unexisted directory which will be generated in the command execution process.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --outdir=my_mic_out  --logfile=log.file
+grep "Finished" log.file
+if [ -e my_mic_out/platform.img ]; then echo " Image found. " ; else echo "Image not found." && exit 1 ; fi
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm log.file
+sudo rm -rf ./my_mic_out
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_outdir-current-dir_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_outdir-current-dir_native_ia32.case
new file mode 100644 (file)
index 0000000..79da8b2
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>This test case is used to test the option "--outdir",
+it can be set to an existed directory and also can be set to an unexisted directory which will be generated in the command execution process.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -o my_mic_out --runtime=native --logfile=log.file
+grep "Finished" log.file
+if [ -e my_mic_out/platform.img ]; then echo " Image found. " ; else echo "Image not found." && exit 1 ; fi
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm log.file
+sudo rm -rf ./my_mic_out
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_outdir-root-dir_ia32.case b/cases/create/opt_cases/mic_cr_loop_outdir-root-dir_ia32.case
new file mode 100644 (file)
index 0000000..95e35e3
--- /dev/null
@@ -0,0 +1,22 @@
+<testcase>
+  <summary>This test case is used to test the option "--outdir",in this case,
+a subdirectory under /root is given to it, related images should can be found under the given directory.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -o /root/my_mic_out  --logfile=log.file
+grep "Finished" log.file
+sudo test -f /root/my_mic_out/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf /root/my_mic_out log.file
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_outdir-root-dir_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_outdir-root-dir_native_ia32.case
new file mode 100644 (file)
index 0000000..b127fe2
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>This test case is used to test the option "--outdir",in this case,
+a subdirectory under /root is given to it, related images should can be found under the given directory.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --outdir=/root/my_mic_out \
+  --runtime=native \
+  --logfile=log.file
+grep "Finished" log.file
+sudo test -f /root/my_mic_out/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf /root/my_mic_out log.file
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-Invalid_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-Invalid_ia32.case
new file mode 100644 (file)
index 0000000..c273856
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .bz2</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --pack-to=@NAME@.bz2  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.bz2.tar
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo tar -xvf ./mic-output/handset_blackbay*.bz2.tar -C ./mic-output
+sudo test -f ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tar-bz2_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tar-bz2_ia32.case
new file mode 100644 (file)
index 0000000..dcd6c07
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tar.bz2</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --pack-to=@NAME@.tar.bz2 --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tar.bz2
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo bunzip2 -d ./mic-output/handset_blackbay*.tar.bz2
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tar-bz2_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tar-bz2_native_ia32.case
new file mode 100644 (file)
index 0000000..b762894
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tar.bz2 in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --pack-to=@NAME@.tar.bz2 \
+  --runtime=native \
+  --logfile=mic.log
+(! grep -i 'start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tar.bz2
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo bunzip2 -d ./mic-output/handset_blackbay*.tar.bz2
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tar-bz_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tar-bz_ia32.case
new file mode 100644 (file)
index 0000000..e5a1d1f
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tar.bz2</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --pack-to=@NAME@.tar.bz --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tar.bz
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo bunzip2 -d ./mic-output/handset_blackbay*.tar.bz
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tar-gz_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tar-gz_ia32.case
new file mode 100644 (file)
index 0000000..3234c9f
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tar.gz</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --pack-to=@NAME@.tar.gz  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tar.gz
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo gunzip  ./mic-output/handset_blackbay*.tar.gz
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tar-gz_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tar-gz_native_ia32.case
new file mode 100644 (file)
index 0000000..e650624
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tar.gz in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --pack-to=@NAME@.tar.gz  \
+  --runtime=native \
+  --logfile=mic.log
+(! grep -i 'start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tar.gz
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo gunzip  ./mic-output/handset_blackbay*.tar.gz
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tar-lzo_native.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tar-lzo_native.case
new file mode 100644 (file)
index 0000000..b5287fe
--- /dev/null
@@ -0,0 +1,32 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tar.lzo,
+  for now, only support lzop format in native mode
+ </summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+if ! which lzop; then
+    sudo spm install lzop
+fi
+sudo mic cr -d -v  loop handset_blackbay.ks --runtime=native\
+  --pack-to=@NAME@.tar.lzo \
+  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tar.lzo
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo lzop -d  mic-output/handset_blackbay*.tar.lzo
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tar_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tar_ia32.case
new file mode 100644 (file)
index 0000000..b3a4822
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is @NAME@</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --pack-to=@NAME@  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tar
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -f ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tar_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tar_native_ia32.case
new file mode 100644 (file)
index 0000000..6377871
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is @NAME@ in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --pack-to=@NAME@ \
+  --runtime=native \
+  --logfile=mic.log
+(! grep -i 'start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tar
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -f ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-taz.case b/cases/create/opt_cases/mic_cr_loop_pack-to-taz.case
new file mode 100644 (file)
index 0000000..c5a574a
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .taz</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --pack-to=@NAME@.taz \
+  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.taz
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo gunzip mic-output/handset_blackbay*.taz
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tbz2_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tbz2_ia32.case
new file mode 100644 (file)
index 0000000..102864c
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tbz2</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --pack-to=@NAME@.tbz2 --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tbz2
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo bunzip2 -d ./mic-output/handset_blackbay*.tbz2
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tbz_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tbz_ia32.case
new file mode 100644 (file)
index 0000000..8553fa4
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tbz</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --pack-to=@NAME@.tbz --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tbz
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo bunzip2 -d ./mic-output/handset_blackbay*.tbz
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tgz.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tgz.case
new file mode 100644 (file)
index 0000000..8cbb01e
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tgz</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --pack-to=@NAME@.tgz \
+  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tgz
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo gunzip ./mic-output/handset_blackbay*.tgz
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-tzo_native.case b/cases/create/opt_cases/mic_cr_loop_pack-to-tzo_native.case
new file mode 100644 (file)
index 0000000..181dbd5
--- /dev/null
@@ -0,0 +1,30 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .tzo</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+if ! which lzop; then
+    sudo spm install lzop
+fi
+sudo mic cr -d -v  loop handset_blackbay.ks --runtime=native\
+  --pack-to=@NAME@.tzo \
+  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.tzo
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo lzop -d  mic-output/handset_blackbay*.tzo
+sudo tar -xvf ./mic-output/handset_blackbay*.tar -C ./mic-output
+sudo test -e ./mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-zip_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-zip_ia32.case
new file mode 100644 (file)
index 0000000..0cad277
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .zip</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --pack-to=@NAME@.zip \
+  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.zip
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo unzip ./mic-output/handset_blackbay*.zip -d ./mic-output
+test -e ./mic-output/platform.img
+sudo mic chroot ./mic-output/platform.img ls
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pack-to-zip_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_pack-to-zip_native_ia32.case
new file mode 100644 (file)
index 0000000..d3b3bff
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>create loop image with arch ia32 and --pack-to is .zip in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --pack-to=@NAME@.zip \
+  --logfile=mic.log \
+  --runtime=native
+(! grep -i 'start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+test -f ./mic-output/handset_blackbay*.zip
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo unzip  ./mic-output/handset_blackbay*.zip -d ./mic-output
+test -e ./mic-output/platform.img
+sudo mic chroot ./mic-output/platform.img ls
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pkgmgr-Invalid_ia32.case b/cases/create/opt_cases/mic_cr_loop_pkgmgr-Invalid_ia32.case
new file mode 100644 (file)
index 0000000..b6b76d4
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>create loop image with invalid pkgmgr option</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  loop handset_blackbay.ks --pkgmgr=None 2>&1 | tee mic.log)
+grep -i "Can't find backend: None" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pkgmgr-yum_ia32.case b/cases/create/opt_cases/mic_cr_loop_pkgmgr-yum_ia32.case
new file mode 100644 (file)
index 0000000..3d0f69d
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>create loop image with pkgmgr is yum</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  loop handset_blackbay.ks --pkgmgr=yum 2>&1 | tee mic.log)
+grep -i "Can't find backend: yum" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pkgmgr-zypp_ia32.case b/cases/create/opt_cases/mic_cr_loop_pkgmgr-zypp_ia32.case
new file mode 100644 (file)
index 0000000..7791d36
--- /dev/null
@@ -0,0 +1,22 @@
+<testcase>
+  <summary>create loop image with ia32 arch and zypp pkgmgr</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --pkgmgr=zypp  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_pkgmgr-zypp_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_pkgmgr-zypp_native_ia32.case
new file mode 100644 (file)
index 0000000..79148b9
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create loop image with ia32 arch and zypp pkgmgr</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --pkgmgr=zypp \
+  --runtime=native \
+  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_record-pkgs-Invalid_ia32.case b/cases/create/opt_cases/mic_cr_loop_record-pkgs-Invalid_ia32.case
new file mode 100644 (file)
index 0000000..17410be
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>create loop image with invalid --record-pkgs option</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  loop handset_blackbay.ks --record-pkgs=propery  2>&1 | tee mic.log)
+grep -i 'Invalid pkg recording: propery' mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_record-pkgs-name-content-license-vcs_ia32.case b/cases/create/opt_cases/mic_cr_loop_record-pkgs-name-content-license-vcs_ia32.case
new file mode 100644 (file)
index 0000000..bd9bc35
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>create loop image with ia32 arch and --record-pkgs is name, content, license, vcs</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --record-pkgs=name,content,license,vcs \
+  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+cat ./mic-output/handset_blackbay*.packages | grep bash
+cat ./mic-output/handset_blackbay*.license | grep bash
+cat ./mic-output/handset_blackbay*.files | grep bash
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning...."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning...."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_record-pkgs-name-content-license-vcs_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_record-pkgs-name-content-license-vcs_native_ia32.case
new file mode 100644 (file)
index 0000000..0ba103a
--- /dev/null
@@ -0,0 +1,28 @@
+<testcase>
+  <summary>create loop image with ia32 arch and --record-pkgs is name, content, license, vcs</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --record-pkgs=name,content,license,vcs \
+  --runtime=native \
+  --logfile=mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+cat ./mic-output/handset_blackbay*.packages | grep bash
+cat ./mic-output/handset_blackbay*.license | grep bash
+cat ./mic-output/handset_blackbay*.files | grep bash
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning...."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning...."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_release_check_log_completeness.case b/cases/create/opt_cases/mic_cr_loop_release_check_log_completeness.case
new file mode 100644 (file)
index 0000000..dc69ca5
--- /dev/null
@@ -0,0 +1,32 @@
+<testcase>
+  <summary>This test case is used to test the option "--release",
+find a version number which contains existed images in the repo specified in handset_blackbay.ks,
+then test whether image will generate correspondently.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic --non-interactive cr loop handset_blackbay.ks --release=tizen-2.2_20130719.3
+grep "Finished" ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.log
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/MD5SUMS
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.packages
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.ks
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay/tizen-2.2_20130719.3_handset_blackbay.xml
+grep "Retrieving repo metadata" ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.log | wc -l | xargs test 2 -le
+grep "Start mic in bootstrap" ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.log
+grep "Installing" ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.log | wc -l | xargs test 2 -lt
+grep "The new image can be found here" ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.log
+
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_release_ia32.case b/cases/create/opt_cases/mic_cr_loop_release_ia32.case
new file mode 100644 (file)
index 0000000..0ed454e
--- /dev/null
@@ -0,0 +1,27 @@
+<testcase>
+  <summary>This test case is used to test the option "--release",
+find a version number which contains existed images in the repo specified in handset_blackbay.ks,
+then test whether image will generate correspondently.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic --non-interactive cr loop handset_blackbay.ks --release=tizen-2.2_20130719.3
+grep "Finished" ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.log
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/MD5SUMS
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.packages
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.ks
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay/tizen-2.2_20130719.3_handset_blackbay.xml
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_release_latest_ia32.case b/cases/create/opt_cases/mic_cr_loop_release_latest_ia32.case
new file mode 100644 (file)
index 0000000..6253192
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary></summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic --non-interactive cr loop handset_blackbay.ks  --release=latest
+grep "Finished" ./mic-output/latest/images/handset_blackbay*/latest_handset_blackbay.log
+sudo test -f ./mic-output/latest/images/handset_blackbay*/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo test -f ./mic-output/latest/images/handset_blackbay*/MD5SUMS
+sudo test -f ./mic-output/latest/images/handset_blackbay*/latest_handset_blackbay.packages
+sudo test -f ./mic-output/latest/images/handset_blackbay*/latest_handset_blackbay.ks
+sudo test -f ./mic-output/latest/images/handset_blackbay*/latest_handset_blackbay.xml
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_release_native_ia32.case b/cases/create/opt_cases/mic_cr_loop_release_native_ia32.case
new file mode 100644 (file)
index 0000000..6e90315
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>This test case is used to test the option "--release",
+find a version number which contains existed images in the repo specified in handset_blackbay.ks,
+then test whether image will generate correspondently.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic --non-interactive cr loop handset_blackbay.ks \
+  --release=tizen-2.2_20130719.3 \
+  --runtime=native
+grep "Finished" ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.log
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/MD5SUMS
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.packages
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay*/tizen-2.2_20130719.3_handset_blackbay.ks
+sudo test -f ./mic-output/tizen-2.2_20130719.3/images/handset_blackbay/tizen-2.2_20130719.3_handset_blackbay.xml
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_repo_ia32.case b/cases/create/opt_cases/mic_cr_loop_repo_ia32.case
new file mode 100644 (file)
index 0000000..767430b
--- /dev/null
@@ -0,0 +1,35 @@
+<testcase>
+  <version>1.0</version>
+  <summary>Test option "--repo" and "--ignore-ksrepo"</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay_test_repo.ks" />
+    <copy src="conf/mic_proxy.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+# give one repo in command line, another in ks
+sudo mic cr -d -v  loop handset_blackbay_test_repo.ks --repo "name=Tizen-main;baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/" --logfile=handset1.log
+grep 'Finished' handset1.log
+test -e mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+# give two repos in command line and ignore ks repo
+sudo mic cr -d -v  loop handset_blackbay_test_repo.ks --repo "name=Tizen-main;baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/" --repo "name=Tizen-base;baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/" --logfile=handset2.log --ignore-ksrepo
+grep 'Finished' handset2.log
+# give one repo in command line and one in ks, ignore ks repo
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  loop handset_blackbay_test_repo.ks --repo "name=Tizen-main;baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/" --logfile=handset3.log --ignore-ksrepo)
+grep -i "Unable to find package" handset3.log
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -e mic-output && sudo rm -rf ./mic-output
+test -e handset1.log && sudo rm handset1.log
+test -e handset2.log && sudo rm handset2.log
+test -e handset3.log && sudo rm handset3.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_runtime-Invalid_ia32.case b/cases/create/opt_cases/mic_cr_loop_runtime-Invalid_ia32.case
new file mode 100644 (file)
index 0000000..bb525ea
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>create mic with invalid runtime option</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  loop handset_blackbay.ks --runtime=invalid  2>&1 | tee mic.log)
+grep -i "Invalid runtime mode: invalid" mic.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_runtime-bootstrap_ia32.case b/cases/create/opt_cases/mic_cr_loop_runtime-bootstrap_ia32.case
new file mode 100644 (file)
index 0000000..4f7dbb9
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create loop image with ia32 arch and --runtime is bootstrap</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks \
+  --runtime=bootstrap \
+  --logfile=mic.log
+grep 'Start mic in bootstrap' mic.log
+grep 'Finished' mic.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm mic.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_runtime-native_ia32.case b/cases/create/opt_cases/mic_cr_loop_runtime-native_ia32.case
new file mode 100644 (file)
index 0000000..3bed58b
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>create loop image with ia32 arch and native mode</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --runtime=native --logfile=mic.log
+(! grep -i 'start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+test -f ./mic-output/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf /mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_shrink_ia32.case b/cases/create/opt_cases/mic_cr_loop_shrink_ia32.case
new file mode 100644 (file)
index 0000000..c9f968e
--- /dev/null
@@ -0,0 +1,33 @@
+<testcase>
+  <summary>create loop image with ia32 arch and shrink option</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="scripts/compute_volume.sh" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -o out1 --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./out1/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks -o out2 --shrink --logfile=mic2.log
+grep 'Finished' mic2.log
+test -f ./out2/platform.img
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+source compute_volume.sh
+p1=`compute_volume ./out1/platform.img`
+p2=`compute_volume ./out2/platform.img`
+result=`awk -v before_volume=$p1 -v cpmpress_volume=$p2 'BEGIN {print(before_volume>cpmpress_volume)?"yes":"no"}'`
+test $result = 'yes'
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/ ./out2/
+sudo rm mic1.log mic2.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_loop_tmpfs.case b/cases/create/opt_cases/mic_cr_loop_tmpfs.case
new file mode 100644 (file)
index 0000000..a254e58
--- /dev/null
@@ -0,0 +1,22 @@
+<testcase>
+  <summary>Test option "--tmpfs",</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  loop handset_blackbay.ks --tmpfs --logfile=./log/handset.log
+test -f ./log/handset.log
+grep 'Finished' ./log/handset.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm ./log/handset.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_proxy_in_custom_conf.case b/cases/create/opt_cases/mic_cr_proxy_in_custom_conf.case
new file mode 100644 (file)
index 0000000..0e43782
--- /dev/null
@@ -0,0 +1,43 @@
+<testcase>
+  <version>1.0</version>
+  <summary>test proxy in custom config file</summary>
+  <fixtures>
+    <copy src="ks_files/ivi-mbr-i586.ks" />
+    <copy src="conf/mic_proxy.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+# make sure the proxy is off in /etc/sysconfig/proxy
+if [ -f /etc/sysconfig/proxy ];then
+    sudo sed -i 's/PROXY_ENABLED\s*=\s*".*"/PROXY_ENABLED="no"/' /etc/sysconfig/proxy
+fi
+if [ -f /etc/mic/mic.conf ];then
+    sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+    sudo cp mic_proxy.conf /etc/mic/mic.conf
+else
+    sudo cp mic_proxy.conf /etc/mic/mic.conf
+fi
+# make sure proxy is off in terminal
+unset http_proxy
+unset https_proxy
+unset no_proxy
+sudo  mic cr raw ivi-mbr-i586.ks --logfile=log.file -d -v --runtime=native
+grep "Finished" log.file
+sudo test -e ./mic-output/ivi-mbr-i586*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+if [ -f /etc/mic/mic.conf.bak ];then
+    sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+else
+    sudo rm -f /etc/mic/mic.conf
+fi
+test -d ./mic-output && sudo rm -rf ./mic-output/
+test -f log.file && sudo rm log.file
+echo 'finish cleaning...'
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_proxy_in_terminal.case b/cases/create/opt_cases/mic_cr_proxy_in_terminal.case
new file mode 100644 (file)
index 0000000..1d69d1d
--- /dev/null
@@ -0,0 +1,43 @@
+<testcase>
+  <version>1.0</version>
+  <summary>test proxy in terminal</summary>
+  <fixtures>
+    <copy src="ks_files/ivi-mbr-i586.ks" />
+    <copy src="conf/mic.conf" />
+  </fixtures>  
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+# make sure the proxy is off in /etc/sysconfig/proxy
+if [ -f /etc/sysconfig/proxy ];then
+    sudo sed -i 's/PROXY_ENABLED\s*=\s*".*"/PROXY_ENABLED="no"/' /etc/sysconfig/proxy
+fi
+# make sure proxy in /etc/mic/mic.conf is off
+if [ -f /etc/mic/mic.conf ];then
+    sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+    sudo cp mic.conf /etc/mic/
+else
+    sudo cp mic.conf /etc/mic/
+fi
+export http_proxy=http://proxy-mu.intel.com:911
+export https_proxy=http://proxy-mu.intel.com:911
+export no_proxy=.intel.com
+sudo mic cr raw ivi-mbr-i586.ks --logfile=mic1.log -d -v --runtime=native
+grep 'Finished' mic1.log
+test -f ./my_mic-output/ivi-mbr-i586*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+if [ -f /etc/mic/mic.conf.bak ];then
+    sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+else
+    sudo rm -f /etc/mic/mic.conf
+fi
+test -d ./my_mic-output && sudo rm -rf ./my_mic-output/
+test -f mic1.log && sudo rm mic1.log
+echo 'finish cleaning...'
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_qcow_logfile-current-file_ia32.case b/cases/create/opt_cases/mic_cr_qcow_logfile-current-file_ia32.case
new file mode 100644 (file)
index 0000000..3d13ff4
--- /dev/null
@@ -0,0 +1,31 @@
+<testcase>
+  <summary>Test '--logfile' option of 'qcow' format image</summary>
+  <fixtures>
+    <copy src="ks_files/qcow_image.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+hostname=$(hostname)
+sudo mic cr -d -v qcow qcow_image.ks --logfile=./log/qcow.log -k /home/build/mic-tmp-cache
+# use '-k /home/build/mic-tmp-cache', because directory '/home/build/' has larger space, if
+# use default cache dir, mic will throw error 'Failed to umount /var/***/install_root' on
+# Ubuntu_12.04_64bit qemu-kvm
+test -f ./log/qcow.log
+test -e ./mic-output/emulimg-3.0.img
+file ./mic-output/emulimg-3.0.img | grep -i 'QCOW'
+grep 'Finished' ./log/qcow.log
+grep "$hostname" ./log/qcow.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+egrep 'mic [0-9]{1,2}\.[0-9]+' ./log/qcow.log
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm ./log/qcow.log
+test -d /home/build/mic-tmp-cache && sudo rm -rf /home/build/mic-tmp-cache
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_compress-image-bz2_ia32.case b/cases/create/opt_cases/mic_cr_raw_compress-image-bz2_ia32.case
new file mode 100644 (file)
index 0000000..83866bb
--- /dev/null
@@ -0,0 +1,43 @@
+<testcase>
+  <summary>create raw image with ia32 arch and compress-image option with bz2</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+    <copy src="scripts/compute_volume.sh" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+enforce_path=$(sudo which setenforce || true)
+if [ ! -z $enforce_path ];then
+    sudo $enforce_path 0 || true
+fi
+sudo mic cr raw ivi.ks -o out1 -d -v --logfile=mic1.log
+grep 'Finished' mic1.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi.ks --compress-image=bz2 -o out2 -d -v --logfile=mic2.log
+grep 'Finished' mic2.log
+test -f ./out2/ivi*.raw.bz2
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+source compute_volume.sh
+cd out1
+name1=`ls ivi*.raw`
+p1=`compute_volume $name1`
+cd ../out2
+name2=`ls ivi*.raw.bz2`
+p2=`compute_volume $name2`
+result=`awk -v before_volume=$p1 -v cpmpress_volume=$p2 'BEGIN {print(before_volume>cpmpress_volume)?"yes":"no"}'`
+test $result = 'yes'
+sudo bunzip2 $name2
+raw_name=`ls ivi*.raw`
+test -f $raw_name
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/ ./out2/
+sudo rm mic1.log mic2.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_compress-image-gz_ia32.case b/cases/create/opt_cases/mic_cr_raw_compress-image-gz_ia32.case
new file mode 100644 (file)
index 0000000..e1306f8
--- /dev/null
@@ -0,0 +1,39 @@
+<testcase>
+  <summary>create raw image with ia32 arch and compress-image option with gz</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+    <copy src="scripts/compute_volume.sh" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi.ks -o out1 -d -v --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./out1/ivi*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi.ks --compress-image=gz -o out2 -d -v --logfile=mic2.log
+grep 'Finished' mic2.log
+test -f ./out2/ivi*.raw.gz
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+source compute_volume.sh
+cd out1
+name1=`ls ivi*.raw`
+p1=`compute_volume $name1`
+cd ../out2
+name2=`ls ivi*.raw.gz`
+p2=`compute_volume $name2`
+result=`awk -v before_volume=$p1 -v cpmpress_volume=$p2 'BEGIN {print(before_volume>cpmpress_volume)?"yes":"no"}'`
+test $result = 'yes'
+sudo gunzip $name2
+raw_name=`ls ivi*.raw`
+test -f $name
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/ ./out2/
+sudo rm mic1.log mic2.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_compress-image-invalid_ia32.case b/cases/create/opt_cases/mic_cr_raw_compress-image-invalid_ia32.case
new file mode 100644 (file)
index 0000000..24893be
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>create raw image with ia32 arch and compress-image option with invalid option, like zip</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+! (sudo mic cr -d -v  raw ivi.ks --compress-image=zip 2>&1 | tee mic2.log )
+grep  "compress-image: invalid choice: 'zip'" mic2.log
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -f mic2.log
+sudo rm -rf ./mic-output
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_compress-image-lzo_native_ia32.case b/cases/create/opt_cases/mic_cr_raw_compress-image-lzo_native_ia32.case
new file mode 100644 (file)
index 0000000..294d439
--- /dev/null
@@ -0,0 +1,42 @@
+<testcase>
+  <summary>create raw image with ia32 arch and compress-image option with lzo</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+    <copy src="scripts/compute_volume.sh" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+if ! which lzop; then
+    sudo spm install lzop
+fi
+sudo mic cr raw ivi.ks -o out1 -d -v --logfile=mic1.log --runtime=native
+grep 'Finished' mic1.log
+test -f ./out1/ivi*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi.ks --compress-image=lzo -o out2 -d -v --logfile=mic2.log --runtime=native
+grep 'Finished' mic2.log
+test -e ./out2/ivi*.raw.lzo
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+source compute_volume.sh
+cd out1
+name1=`ls ivi*.raw`
+p1=`compute_volume $name1`
+cd ../out2
+name2=`ls ivi*.raw.lzo`
+p2=`compute_volume $name2`
+result=`awk -v before_volume=$p1 -v compress_volume=$p2 'BEGIN {print(before_volume>compress_volume)?"yes":"no"}'`
+test $result = 'yes'
+sudo lzop -x $name2
+raw_name=`ls ivi*.raw`
+test -e $name
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./out1/ ./out2/
+sudo rm mic1.log mic2.log
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_fstab-entry-name.case b/cases/create/opt_cases/mic_cr_raw_fstab-entry-name.case
new file mode 100644 (file)
index 0000000..1371bc8
--- /dev/null
@@ -0,0 +1,59 @@
+<testcase>
+  <summary>This test case is used to test the option "--fstab-entry=name",</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw  ivi.ks -d -v --fstab-entry=name --logfile=log.file
+grep "Finished" log.file
+ls mic-output/ | grep 'ivi-.*-sdb.raw'
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+raw_image=$(ls mic-output/ivi-*-sdb.raw)
+sudo mkdir -p mic-output/ivi_dir/boot
+kpartx_path=$(sudo which kpartx)
+for i in {1..5}
+do
+    kpartx_output=$(sudo $kpartx_path -av $raw_image)
+    if [ -n "$kpartx_output" ]; then
+        first_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '1p')
+        second_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '2p')
+        ls /dev/mapper/
+        if [ -n "$first_part" ] && [ -e "/dev/mapper/$first_part" ];then
+            sudo mount /dev/mapper/$first_part  mic-output/ivi_dir/boot/ -t ext4
+            sudo mount /dev/mapper/$second_part  mic-output/ivi_dir/ -t ext4
+            sudo chroot mic-output/ivi_dir/ cat /etc/fstab | grep /dev/sdb
+            (! sudo chroot mic-output/ivi_dir/ cat /etc/fstab | grep -i 'uuid')
+            exit 0
+       fi
+   fi
+   sleep 3
+done
+echo "can not get kpartx output: $kpartx_path -av $raw_image"
+exit 1
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+raw_image=$(ls mic-output/ivi-*-sdb.raw)
+losetup_path=$(sudo which losetup)
+if [ -f $raw_image ];then
+    for i in {1..5}
+    do
+    test -d mic-output/ivi_dir && sudo umount -l mic-output/ivi_dir
+    test -d mic-output/ivi_dir/boot && sudo umount -l mic-output/ivi_dir/boot
+    kpartx_path=$(sudo which kpartx)
+    sudo $kpartx_path -d $raw_image
+    if sudo $losetup_path -a | grep "ivi"; then
+        sleep 2
+    else
+        test -d mic-output && sudo rm -rf ./mic-output
+        break
+    fi
+    done
+fi
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_fstab-entry-uuid.case b/cases/create/opt_cases/mic_cr_raw_fstab-entry-uuid.case
new file mode 100644 (file)
index 0000000..ea249f5
--- /dev/null
@@ -0,0 +1,60 @@
+<testcase>
+  <summary>This test case is used to test the option "--fstab-entry=uuid",</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr raw ivi.ks --fstab-entry=uuid -d -v --logfile=log.file
+grep "Finished" log.file
+ls mic-output/ | grep 'ivi-.*-sdb.raw'
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+raw_image=$(ls mic-output/ivi-*-sdb.raw)
+sudo mkdir -p mic-output/ivi_dir/boot
+kpartx_path=$(sudo which kpartx)
+for i in {1..5}
+do
+    kpartx_output=$(sudo $kpartx_path -av $raw_image)
+    if [ -n "$kpartx_output" ]; then
+        first_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '1p')
+        second_part=$(echo "$kpartx_output"| awk '{print $3}' | sed -n '2p')
+        ls /dev/mapper/
+        if [ -n "$kpartx_output" ] && [ -e "/dev/mapper/$first_part" ];then
+            sudo mount /dev/mapper/$first_part  mic-output/ivi_dir/boot/ -t ext4
+            sudo mount /dev/mapper/$second_part  mic-output/ivi_dir/ -t ext4
+            (! sudo chroot mic-output/ivi_dir/ cat /etc/fstab | grep /dev/sdb)
+            sudo chroot mic-output/ivi_dir/ cat /etc/fstab | grep -i 'uuid'
+            exit 0
+        fi
+     fi
+     sleep 3
+done
+echo "can not get kpartx output: $kpartx_path -av $raw_image"
+exit 1
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+raw_image=$(ls mic-output/ivi-*-sdb.raw)
+losetup_path=$(sudo which losetup)
+if [ -f $raw_image ];then
+    for i in {1..5}
+    do
+    test -d mic-output/ivi_dir && sudo umount -l mic-output/ivi_dir
+    test -d mic-output/ivi_dir/boot && sudo umount -l mic-output/ivi_dir/boot
+    kpartx_path=$(sudo which kpartx)
+    sudo $kpartx_path -d $raw_image
+    if sudo $losetup_path -a | grep 'ivi'; then
+        sleep 2
+    else
+        test -d mic-output && sudo rm -rf ./mic-output
+        break
+    fi
+    done
+fi
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_fstab-name_gpt_native_ia32.case b/cases/create/opt_cases/mic_cr_raw_fstab-name_gpt_native_ia32.case
new file mode 100644 (file)
index 0000000..f6ee435
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create raw image with ia32 arch and --fstab-entry=name  option in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/ivi_four_partition_gpt.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi_four_partition_gpt.ks \
+  --runtime=native \
+  --fstab-entry=name \
+  --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./mic-output/ivi_four_partition_gpt-*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output/
+test -f 'mic1.log' && sudo rm mic1.log
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_fstab-name_native.case b/cases/create/opt_cases/mic_cr_raw_fstab-name_native.case
new file mode 100644 (file)
index 0000000..e9b065d
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create raw image with x86_64 arch and --fstab-entry=name  option in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi.ks \
+  --runtime=native \
+  --fstab-entry=name \
+  --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./mic-output/ivi*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output/
+test -f 'mic1.log' && sudo rm mic1.log
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_fstab-uuid_gpt_native_ia32.case b/cases/create/opt_cases/mic_cr_raw_fstab-uuid_gpt_native_ia32.case
new file mode 100644 (file)
index 0000000..c5fc22a
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create raw image with ia32 arch and --fstab=uuid  option in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/ivi_four_partition_gpt.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi_four_partition_gpt.ks \
+  --runtime=native \
+  --fstab=uuid \
+  --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./mic-output/ivi_four_partition_gpt-*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output/
+test -f 'mic1.log' && sudo rm mic1.log
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_fstab-uuid_native.case b/cases/create/opt_cases/mic_cr_raw_fstab-uuid_native.case
new file mode 100644 (file)
index 0000000..3fd911e
--- /dev/null
@@ -0,0 +1,25 @@
+<testcase>
+  <summary>create raw image with x86_64 arch and --fstab=uuid  option in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi.ks \
+  --runtime=native \
+  --fstab=uuid \
+  --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./mic-output/ivi*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -d ./mic-output && sudo rm -rf ./mic-output/
+test -f 'mic1.log' && sudo rm mic1.log
+echo 'finish cleaning'
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_generate-bmap_ia32.case b/cases/create/opt_cases/mic_cr_raw_generate-bmap_ia32.case
new file mode 100644 (file)
index 0000000..26770ce
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>create loop image with ia32 arch and shrink option</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi.ks --generate-bmap --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./mic-output/ivi*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f ./mic-output/ivi*.bmap
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output/
+sudo rm mic1.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_generate-bmap_ia32_native.case b/cases/create/opt_cases/mic_cr_raw_generate-bmap_ia32_native.case
new file mode 100644 (file)
index 0000000..4a53cd3
--- /dev/null
@@ -0,0 +1,23 @@
+<testcase>
+  <summary>create raw image with ia32 arch and '--generate-bmap' option in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi.ks --generate-bmap --runtime=native --logfile=mic1.log
+grep 'Finished' mic1.log
+test -f ./mic-output/ivi*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+test -f ./mic-output/ivi*.bmap
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output/
+sudo rm mic1.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_install-pkgs_native_ia32.case b/cases/create/opt_cases/mic_cr_raw_install-pkgs_native_ia32.case
new file mode 100644 (file)
index 0000000..e588dcd
--- /dev/null
@@ -0,0 +1,74 @@
+<testcase>
+  <summary>create raw image with ia32 arch and "--install-pkgs" '--runtime=native' option</summary>
+  <fixtures>
+    <copy src="ks_files/ivi-2.0-alpha-debuginfo.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi-2.0-alpha-debuginfo.ks \
+  --install-pkgs=debuginfo \
+  --runtime=native \
+  --logfile=mic1.log
+grep 'Finished' mic1.log
+raw_image=$(ls ./mic-output/ivi-2.0-alpha-debuginfo-*-sdb.raw)
+test -f $raw_image
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mkdir -p mic-output/ivi_dir/boot
+kpartx_path=$(sudo which kpartx)
+loop_device=$(sudo $losetup_path -f)
+sudo $losetup_path $loop_device $raw_image
+for i in {1..5}
+do
+    kpartx_output=$(sudo $kpartx_path -av $loop_device)
+    if [ -n "$kpartx_output" ]; then
+        first_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '1p')
+        second_part=$(echo "$kpartx_output" | awk '{print $3}' | sed -n '2p')
+        if [ -n "$first_part" ] && [ -n "$second_part" ];then
+            for j in {1..5}
+            do
+                ls /dev/mapper/
+                if [ -e "/dev/mapper/$first_part" ] && [ -e "/dev/mapper/$second_part" ];then
+                    sudo mount /dev/mapper/$first_part  mic-output/ivi_dir/boot/ -t ext4
+                    sudo mount /dev/mapper/$second_part  mic-output/ivi_dir/ -t ext4
+                    sudo chroot mic-output/ivi_dir/ rpm -qa | grep 'debuginfo'
+                    exit 0
+                else
+                    sleep 2
+                fi
+            done
+        fi
+    fi
+    sleep 3
+done
+echo "can not get kpartx output: $kpartx_path -av $raw_image"
+exit 1
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f mic1.log && sudo rm -f mic1.log
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+loop_devices=$(sudo $losetup_path -a | awk -F ":" '{print $1}')
+for i in {1..5}
+do
+    for loop_device in $loop_devices
+    do
+        test -d mic-output/ivi_dir && sudo umount -l mic-output/ivi_dir
+        test -d mic-output/ivi_dir/boot && sudo umount -l mic-output/ivi_dir/boot
+        kpartx_path=$(sudo which kpartx)
+        sudo $kpartx_path -d $loop_device
+        sudo $losetup_path -d $loop_device
+    done
+    if sudo $losetup_path -a | grep 'ivi-2.0-alpha-debuginfo'; then
+        sleep 2
+    else
+        test -d mic-output && sudo rm -rf ./mic-output
+        break
+    fi
+done
+
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_native_conf_proxy.case b/cases/create/opt_cases/mic_cr_raw_native_conf_proxy.case
new file mode 100644 (file)
index 0000000..55036cc
--- /dev/null
@@ -0,0 +1,26 @@
+<testcase>
+  <version>1.0</version>
+  <summary>This test case is used to test the option "--config",a mic config file name is given to this option,the image will created according to the configurations that is set in the file mic.conf.In this test case, the 'mic.conf' is copied from the default mic.conf which locates at "/etc/mic/" with modifying the "proxy".</summary>
+  <fixtures>
+    <copy src="ks_files/ivi-mbr-i586.ks" />
+    <copy src="conf/mic_proxy.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+unset http_proxy || true
+unset https_proxy || true
+unset no_proxy || true
+sudo mic cr raw ivi-mbr-i586.ks --config=mic_proxy.conf  --logfile=log.file --runtime=native -d -v
+grep "Finished" log.file
+ls mic-output/ | grep 'ivi-mbr-i586-.*-sdb.raw'
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+test -f log.file && sudo rm log.file
+test -d mic-output && sudo rm -rf ./mic-output
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_pack-to-tar-gz_native_ia32.case b/cases/create/opt_cases/mic_cr_raw_pack-to-tar-gz_native_ia32.case
new file mode 100644 (file)
index 0000000..1dfbb5e
--- /dev/null
@@ -0,0 +1,29 @@
+<testcase>
+  <summary>create raw image with arch ia32 and --pack-to is .tar.gz in native mode</summary>
+  <fixtures>
+    <copy src="ks_files/ivi.ks" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo mic cr -d -v  raw ivi.ks \
+  --pack-to=@NAME@.tar.gz \
+  --runtime=native \
+  --logfile=mic.log
+(! grep -i 'Start mic in bootstrap' mic.log)
+grep 'Finished' mic.log
+raw_name=$(ls mic-output/ivi-*.tar.gz)
+test -f $raw_name
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+sudo tar -zxvf $raw_name -C mic-output
+sudo ls mic-output | grep 'ivi-.*-sdb.raw'
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm mic.log
+echo "finish cleaning..."
+]]></teardown>
+</testcase>
diff --git a/cases/create/opt_cases/mic_cr_raw_proxy_with_authentication.case b/cases/create/opt_cases/mic_cr_raw_proxy_with_authentication.case
new file mode 100644 (file)
index 0000000..8a49722
--- /dev/null
@@ -0,0 +1,43 @@
+<testcase>
+  <version>1.0</version>
+  <summary>test proxy in custom config file</summary>
+  <fixtures>
+    <copy src="ks_files/ivi-mbr-i586.ks" />
+    <copy src="conf/mic_proxy_with_authentication.conf" />
+  </fixtures>
+  <steps><![CDATA[
+losetup_path=$(sudo which losetup)
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+# make sure the proxy is off in /etc/sysconfig/proxy
+if [ -f /etc/sysconfig/proxy ];then
+    sudo sed -i 's/PROXY_ENABLED\s*=\s*".*"/PROXY_ENABLED="no"/' /etc/sysconfig/proxy
+fi
+if [ -f /etc/mic/mic.conf ];then
+    sudo mv /etc/mic/mic.conf /etc/mic/mic.conf.bak
+    sudo cp mic_proxy_with_authentication.conf /etc/mic/mic.conf
+else
+    sudo cp mic_proxy_with_authentication.conf /etc/mic/mic.conf
+fi
+# make sure proxy is off in terminal
+unset http_proxy
+unset https_proxy
+unset no_proxy
+sudo mic cr raw ivi-mbr-i586.ks --logfile=mic.log -d -v --runtime=native
+grep 'Finished' mic.log
+test -e ./mic-output/ivi-mbr-i586*.raw
+sudo $losetup_path -a
+sudo $losetup_path -a | wc -l | xargs test 0 -eq
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+if [ -f /etc/mic/mic.conf.bak ];then
+    sudo mv /etc/mic/mic.conf.bak /etc/mic/mic.conf
+else
+    sudo rm -f /etc/mic/mic.conf
+fi
+test -d ./mic-output && sudo rm -rf ./mic-output/
+test -f mic.log && sudo rm mic.log
+echo 'finish cleaning...'
+]]></teardown>
+</testcase>
diff --git a/coveragerc b/coveragerc
new file mode 100644 (file)
index 0000000..55151b2
--- /dev/null
@@ -0,0 +1,3 @@
+[run]
+source = mic
+        /usr/lib/mic/plugins
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..1433cb9
--- /dev/null
@@ -0,0 +1,5 @@
+itest-cases-mic (0.1) unstable; urgency=high
+  * Release to 0.1, which contains the following  features:
+    * add one case to itest-cases-mic 
+
+ -- Huang Hao <hao.h.huang@intel.com>  Wed, 26 Sep 2013 11:45:08 +0800
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7f8f011
--- /dev/null
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..d30d964
--- /dev/null
@@ -0,0 +1,12 @@
+Source: itest-cases-mic
+Section: devel
+Priority: extra
+Maintainer: Huanhuan Li <huanhuanx.li@intel.com>
+Standards-Version: 1.0
+Homepage: http://www.tizen.org
+Build-Depends: debhelper (>= 4.0.0)
+
+Package: itest-cases-mic
+Architecture: all
+Depends: zip, createrepo, tar, man-db
+Description: Cases for mic functional testing
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..1c2c739
--- /dev/null
@@ -0,0 +1,7 @@
+Upstream Authors:
+
+    Intel Inc.
+
+Copyright:
+
+    Copyright (C) 2012 Intel Inc.
diff --git a/debian/rules b/debian/rules
new file mode 100644 (file)
index 0000000..708f0e2
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+       dh $@
+
+override_dh_auto_install:
+       make PREFIX=debian/itest-cases-mic install
diff --git a/fixtures/conf/mic.conf b/fixtures/conf/mic.conf
new file mode 100644 (file)
index 0000000..a0d75b1
--- /dev/null
@@ -0,0 +1,35 @@
+[common]
+; general settings
+distro_name = Tizen
+
+plugin_dir = /usr/lib/mic/plugins
+
+[create]
+; settings for create subcommand
+tmpdir= /var/tmp/mic
+cachedir= /var/tmp/mic/cache
+outdir= ./my_mic-output
+runtime=bootstrap
+
+pkgmgr = auto
+
+# to set global proxy for repos
+#proxy = http://proxy.yourcompany.com:8080/
+#no_proxy = localhost,127.0.0.0/8,.yourcompany.com
+
+# prefix will be added in front of generated files
+#name_prefix = output
+
+# to skip all ssl verification for repos
+#ssl_verify = no
+
+[convert]
+; settings for convert subcommand
+
+[chroot]
+; settings for chroot subcommand
+
+[bootstrap]
+rootdir=/var/tmp/mic-bootstrap
+packages=mic-bootstrap-x86-arm
+
diff --git a/fixtures/conf/mic_error.conf b/fixtures/conf/mic_error.conf
new file mode 100644 (file)
index 0000000..6a4a8b1
--- /dev/null
@@ -0,0 +1,35 @@
+[common]
+; general settings
+distro_name = Tizen
+
+plugin_dir = /usr/lib/mic/plugins
+
+[create]
+; settings for create subcommand
+tmpdir= /var/tmp/mic
+cachedir= /var/tmp/mic/cache
+outdir= ./mic-output
+runtime=bootstrap
+
+pkgmgr = auto
+
+# to set global proxy for repos
+proxy = http://proxy.yourcompany.com:8080/
+no_proxy = localhost,127.0.0.0/8,.yourcompany.com
+
+# prefix will be added in front of generated files
+#name_prefix = output
+
+# to skip all ssl verification for repos
+#ssl_verify = no
+
+[convert]
+; settings for convert subcommand
+
+[chroot]
+; settings for chroot subcommand
+
+[bootstrap]
+rootdir=/var/tmp/mic-bootstrap
+packages=mic-bootstrap-x86-arm
+
diff --git a/fixtures/conf/mic_native.conf b/fixtures/conf/mic_native.conf
new file mode 100644 (file)
index 0000000..b6ecb23
--- /dev/null
@@ -0,0 +1,35 @@
+[common]
+; general settings
+distro_name = Tizen
+
+plugin_dir = /usr/lib/mic/plugins
+
+[create]
+; settings for create subcommand
+tmpdir= /var/tmp/mic
+cachedir= /var/tmp/mic/cache
+outdir= ./mic-output
+runtime=native
+
+pkgmgr = auto
+
+# to set global proxy for repos
+#proxy = http://proxy.yourcompany.com:8080/
+#no_proxy = localhost,127.0.0.0/8,.yourcompany.com
+
+# prefix will be added in front of generated files
+#name_prefix = output
+
+# to skip all ssl verification for repos
+#ssl_verify = no
+
+[convert]
+; settings for convert subcommand
+
+[chroot]
+; settings for chroot subcommand
+
+[bootstrap]
+#rootdir=/var/tmp/mic-bootstrap
+rootdir = /mount/tmp/mic/bootstrap
+packages=mic-bootstrap-x86-arm
diff --git a/fixtures/conf/mic_prefix.conf b/fixtures/conf/mic_prefix.conf
new file mode 100644 (file)
index 0000000..d32691d
--- /dev/null
@@ -0,0 +1,35 @@
+[common]
+; general settings
+distro_name = Tizen
+
+plugin_dir = /usr/lib/mic/plugins
+
+[create]
+; settings for create subcommand
+tmpdir= /var/tmp/mic
+cachedir= /var/tmp/mic/cache
+outdir= ./mic-output
+
+pkgmgr = auto
+
+# to set global proxy for repos
+#proxy = http://proxy01.cd.intel.com:911
+#no_proxy = localhost,127.0.0.0/8,.intel.com
+
+# prefix will be added in front of generated files
+name_prefix = prefix
+
+# to skip all ssl verification for repos
+#ssl_verify = no
+
+[convert]
+; settings for convert subcommand
+
+[chroot]
+; settings for chroot subcommand
+
+[bootstrap]
+#rootdir=/var/tmp/mic-bootstrap
+rootdir = /mount/tmp/mic/bootstrap
+packages=mic-bootstrap-x86-arm
+
diff --git a/fixtures/conf/mic_proxy.conf b/fixtures/conf/mic_proxy.conf
new file mode 100644 (file)
index 0000000..e656def
--- /dev/null
@@ -0,0 +1,35 @@
+[common]
+; general settings
+distro_name = Tizen
+
+plugin_dir = /usr/lib/mic/plugins
+
+[create]
+; settings for create subcommand
+tmpdir= /var/tmp/mic
+cachedir= /var/tmp/mic/cache
+outdir= ./mic-output
+
+pkgmgr = auto
+
+# to set global proxy for repos
+proxy = http://proxy-mu.intel.com:911
+no_proxy = .intel.com
+
+# prefix will be added in front of generated files
+#name_prefix = output
+
+# to skip all ssl verification for repos
+#ssl_verify = no
+
+[convert]
+; settings for convert subcommand
+
+[chroot]
+; settings for chroot subcommand
+
+[bootstrap]
+#rootdir=/var/tmp/mic-bootstrap
+rootdir = /mount/tmp/mic/bootstrap
+packages=mic-bootstrap-x86-arm
+
diff --git a/fixtures/conf/mic_proxy_with_authentication.conf b/fixtures/conf/mic_proxy_with_authentication.conf
new file mode 100644 (file)
index 0000000..cb5f92a
--- /dev/null
@@ -0,0 +1,34 @@
+[common]
+; general settings
+distro_name = Tizen
+
+plugin_dir = /usr/lib/mic/plugins
+
+[create]
+; settings for create subcommand
+tmpdir= /var/tmp/mic
+cachedir= /var/tmp/mic/cache
+outdir= ./mic-output
+
+pkgmgr = auto
+
+# to set global proxy for repos
+proxy = http://inteluser:somepasswd@proxy-mu.intel.com:911
+no_proxy = localhost,127.0.0.0/8,.intel.com
+
+# prefix will be added in front of generated files
+#name_prefix = output
+
+# to skip all ssl verification for repos
+#ssl_verify = no
+
+[convert]
+; settings for convert subcommand
+
+[chroot]
+; settings for chroot subcommand
+
+[bootstrap]
+#rootdir=/var/tmp/mic-bootstrap
+rootdir = /mount/tmp/mic/bootstrap
+packages=mic-bootstrap-x86-arm
diff --git a/fixtures/conf/no_proxy_on.conf b/fixtures/conf/no_proxy_on.conf
new file mode 100644 (file)
index 0000000..2f9a5b0
--- /dev/null
@@ -0,0 +1,34 @@
+[common]
+; general settings
+distro_name = Tizen
+
+plugin_dir = /usr/lib/mic/plugins
+
+[create]
+; settings for create subcommand
+tmpdir= /var/tmp/mic
+cachedir= /var/tmp/mic/cache
+outdir= ./mic-output
+runtime=bootstrap
+
+pkgmgr = auto
+
+# to set global proxy for repos
+#proxy = http://proxy.yourcompany.com:8080/
+#no_proxy = localhost,127.0.0.0/8,.yourcompany.com
+no_proxy = localhost,127.0.0.1,.intel.com
+# prefix will be added in front of generated files
+#name_prefix = output
+
+# to skip all ssl verification for repos
+#ssl_verify = no
+
+[convert]
+; settings for convert subcommand
+
+[chroot]
+; settings for chroot subcommand
+
+[bootstrap]
+rootdir=/var/tmp/mic-bootstrap
+packages=mic-bootstrap-x86-arm
diff --git a/fixtures/conf/proxy_on.conf b/fixtures/conf/proxy_on.conf
new file mode 100644 (file)
index 0000000..c316153
--- /dev/null
@@ -0,0 +1,34 @@
+[common]
+; general settings
+distro_name = Tizen
+
+plugin_dir = /usr/lib/mic/plugins
+
+[create]
+; settings for create subcommand
+tmpdir= /var/tmp/mic
+cachedir= /var/tmp/mic/cache
+outdir= ./mic-output
+
+pkgmgr = auto
+
+# to set global proxy for repos
+proxy = http://proxy01.cd.intel.com:911
+#no_proxy = localhost,127.0.0.0/8,.intel.com
+
+# prefix will be added in front of generated files
+#name_prefix = output
+
+# to skip all ssl verification for repos
+#ssl_verify = no
+
+[convert]
+; settings for convert subcommand
+
+[chroot]
+; settings for chroot subcommand
+
+[bootstrap]
+#rootdir=/var/tmp/mic-bootstrap
+rootdir = /mount/tmp/mic/bootstrap
+packages=mic-bootstrap-x86-arm
diff --git a/fixtures/conf/sysconfig_proxy b/fixtures/conf/sysconfig_proxy
new file mode 100644 (file)
index 0000000..93d7a0d
--- /dev/null
@@ -0,0 +1,51 @@
+## Path:       Network/Proxy
+## Description:        
+## Type:       yesno
+## Default:    no
+## Config:      kde,profiles
+#
+# Enable a generation of the proxy settings to the profile.
+# This setting allows to turn the proxy on and off while
+# preserving the particular proxy setup.
+# 
+PROXY_ENABLED="yes"
+
+## Type:       string
+## Default:    ""
+#
+# Some programs (e.g. lynx, arena and wget) support proxies, if set in
+# the environment.  SuSEconfig can add these environment variables to
+# /etc/SuSEconfig/* (sourced by /etc/profile etc.) -
+# See http://portal.suse.com/sdb/en/1998/01/lynx_proxy.html for more details.
+# Example: HTTP_PROXY="http://proxy.provider.de:3128/"
+HTTP_PROXY="http://proxy01.cd.intel.com:911"
+
+## Type:       string
+## Default:    ""
+#
+# Some programs (e.g. lynx, arena and wget) support proxies, if set in
+# the environment.  SuSEconfig can add these environment variables to
+# /etc/SuSEconfig/* (sourced by /etc/profile etc.) -
+# this setting is for https connections
+HTTPS_PROXY=""
+
+## Type:       string
+## Default:    ""
+#
+# Example: FTP_PROXY="http://proxy.provider.de:3128/"
+#
+FTP_PROXY=""
+
+## Type:       string
+## Default:    ""
+#
+# Example: GOPHER_PROXY="http://proxy.provider.de:3128/"
+#
+GOPHER_PROXY=""
+
+## Type:       string(localhost)
+## Default:    localhost
+#
+# Example: NO_PROXY="www.me.de, do.main, localhost"
+#
+NO_PROXY="localhost, 127.0.0.1"
diff --git a/fixtures/ks_files/RD-PQ.ks b/fixtures/ks_files/RD-PQ.ks
new file mode 100644 (file)
index 0000000..7b754ca
--- /dev/null
@@ -0,0 +1,51 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@.tar.gz -*-mic2-options-*-
+
+#
+# Do not Edit! Generated by:
+# kickstarter.py
+#
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+# ROOT fs partition
+part / --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=platform
+# DATA partition
+part /opt/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=data
+# UMS partition
+part /opt/usr/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=ums
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5"
+
+desktop --autologinuser=root
+user --name root  --groups audio,video --password ''
+
+
+repo --name=mobile --baseurl=http://linux-ftp.fi.intel.com/repo/tizen/snapshots/tizen/rd-pq/tizen_20131219.9/repos/mobile/armv7l/packages/ --save  --ssl_verify=no
+
+%packages
+
+coreutils
+bash
+tzdata
+
+
+%end
+
+%post
+# Bug: https://bugs.tizen.org/jira/browse/TDIST-266
+pkg_initdb
+
+# Bug: https://bugs.tizen.org/jira/browse/TDIST-260
+INITDB=1 ail_initdb
+
+# Bug: https://bugs.tizen.org/jira/browse/PTREL-137
+echo "DISPLAY=:0" >> /etc/sysconfig/preload
+
+
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/arm64.ks b/fixtures/ks_files/arm64.ks
new file mode 100644 (file)
index 0000000..07ed7b3
--- /dev/null
@@ -0,0 +1,21 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@.tar.gz -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+# Partitions: size unit is MB
+part /boot --size=64 --ondisk mmcblk0p --fstype=ext4 --label=boot
+part / --size=256 --ondisk mmcblk0p --fstype=ext4 --label=platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5"
+
+desktop --autologinuser=root
+user --name root  --groups audio,video --password ''
+
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/repo/aarch64/  --save --gpgkey=0 --ssl_verify=no
+
+%packages
+filesystem
+%end
diff --git a/fixtures/ks_files/armv7l.ks b/fixtures/ks_files/armv7l.ks
new file mode 100644 (file)
index 0000000..2ae4f50
--- /dev/null
@@ -0,0 +1,45 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@.tar.gz -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+# Partitions: size unit is MB
+part /boot --size=64 --ondisk mmcblk0p --fstype=ext4 --label=boot
+part / --size=256 --ondisk mmcblk0p --fstype=ext4 --label=platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5"   
+
+desktop --autologinuser=root  
+user --name root  --groups audio,video --password ''
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/armv7l/packages/ --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/armv7l/packages/ --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-base-source --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/source/ --save --source --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main-source --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/source/  --save --source --gpgkey=0 --ssl_verify=no
+
+%packages
+shadow-utils
+kernel*
+coreutils
+bash
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/armv7l_with_arch.ks b/fixtures/ks_files/armv7l_with_arch.ks
new file mode 100644 (file)
index 0000000..c92dc01
--- /dev/null
@@ -0,0 +1,43 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@.tar.gz -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+# Partitions: size unit is MB
+part /boot --size=64 --ondisk mmcblk0p --fstype=ext4 --label=boot
+part / --size=456 --ondisk mmcblk0p --fstype=ext4 --label=platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5"   
+
+desktop --autologinuser=root  
+user --name root  --groups audio,video --password ''
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/@ARCH@/packages/ --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/@ARCH@/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+shadow-utils
+kernel*
+coreutils
+bash
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/createrepo_issue.ks b/fixtures/ks_files/createrepo_issue.ks
new file mode 100644 (file)
index 0000000..c23df60
--- /dev/null
@@ -0,0 +1,429 @@
+# -*-mic2-options-*- -f raw --fstab=uuid --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --fstype="ext4" --size=3584 --ondisk=sda --active --label tizen-common --fsoptions=defaults,noatime
+
+rootpw tizen 
+xconfig --startxonboot
+bootloader  --timeout=3  --append="rw vga=current splash rootwait rootfstype=ext4 plymouth.enable=0"   --ptable=gpt --menus="install:Wipe and Install:systemd.unit=system-installer.service:test"
+
+desktop --autologinuser=guest  
+user --name guest  --groups audio,video --password 'tizen'
+
+
+repo --name=common-wayland_i586 --baseurl=file:///var/tmp/temp_repo
+#repo --name=common-wayland_i586 --baseurl=http://download.tizen.org/snapshots/tizen/common/tizen-common_20141010.2/repos/ia32-wayland/packages/ --ssl_verify=no
+
+%packages
+
+#@Generic Base
+#@Common Base
+#@Generic Console Tools
+#@Generic Packaging
+#@Common Packaging
+#@Generic Adaptation
+#@Common Adaptation
+#@Generic Wayland
+#@Common Wayland
+#@Generic Middleware
+#@Common Middleware
+#@Generic Applications
+#@Generic Bluetooth
+#@Generic Multimedia
+#@Generic Desktop Applications
+#@Common Desktop Applications
+#@Generic Crosswalk
+#@Common Crosswalk
+#@Generic Qt5
+#@Common Qt5
+#@Generic Multimedia Intel
+
+#kernel-profile-common
+acl
+
+%end
+
+
+
+%post
+#!/bin/sh
+echo "#################### generic-base.post ####################"
+
+# setup systemd default target for user session
+cat <<'EOF' >>/lib/systemd/user/default.target
+[Unit]
+Description=User session default target
+EOF
+mkdir -p /lib/systemd/user/default.target.wants
+
+# start dbus session
+ln -s ../dbus.service /lib/systemd/user/default.target.wants/
+
+# Run prelink to speed up dynamic binary/library loading
+/usr/sbin/prelink --all
+
+ln -sf /proc/self/mounts /etc/mtab
+
+# sdx: fix smack labels on /var/log
+chsmack -a '*' /var/log
+
+# workaround for bug PTREL-763
+patch -b -p1 -d/ <<'EOF'
+--- bad/etc/pam.d/systemd-user 2014-03-20 10:01:36.657843073 +0100
++++ good/etc/pam.d/systemd-user 2014-03-20 10:06:51.586121696 +0100
+@@ -4,5 +4,6 @@
+ account include system-auth
+ session include system-auth
++session required pam_systemd.so
+ auth required pam_deny.so
+ password required pam_deny.so
+EOF
+
+# create appfw dirs inside homes
+function generic_base_user_exists() {
+       user=$1
+       getent passwd | grep -q ^${user}:
+}
+
+function generic_base_user_home() {
+       user=$1
+       getent passwd | grep ^${user}: | cut -f6 -d':'
+}
+
+function generic_base_fix_user_homedir() {
+       user=$1
+       generic_base_user_exists $user || return 1
+
+       homedir=$(generic_base_user_home $user)
+       mkdir -p $homedir/apps_rw
+       for appdir in desktop manifest dbspace; do
+               mkdir -p $homedir/.applications/$appdir
+       done
+       find $homedir -type d -exec chsmack -a User {} \;
+       chown -R $user:users $homedir
+       return 0
+}
+
+# fix TC-320 for SDK
+. /etc/tizen-build.conf
+[ "${TZ_BUILD_WITH_EMULATOR}" == "1" ] && generic_base_fix_user_homedir developer
+
+#!/bin/sh
+echo "############### common-base.post ################"
+
+######### multiuser mode: create additional users and fix their homedirs
+tizen_crypted_pass=$(perl -e 'print crypt("tizen", "aa")')
+uid=5001
+
+for user in alice bob carol guest; do
+       if ! generic_base_user_exists $user; then
+               useradd -u $uid -d /home/$user -g users -G audio,video,users,display -m --password "$tizen_crypted_pass" $user
+               uid=$(( $uid + 1 ))
+       fi
+
+       generic_base_fix_user_homedir $user
+done
+
+
+
+
+#!/bin/sh
+echo "#################### generic-console-tools.post ####################"
+
+# customize bash prompt
+cat >/etc/profile.d/bash_prompt_custom.sh <<'EOF'
+if [ "$PS1" ]; then
+
+       function proml {
+               # set a fancy prompt (overwrite the one in /etc/profile)
+               local default="\[\e[0m\]"
+               local usercol='\[\e[1;34m\]' # blue
+               local hostcol='\[\e[1;32m\]' # green
+               local pathcol='\[\e[1;33m\]' # yellow
+               local gitcol='\[\e[1;31m\]' # light red
+               local termcmd=''
+               local _p="$";
+
+               if [ "`id -u`" -eq 0 ]; then
+                       usercol='\[\e[1;31m\]'
+                       _p="#"
+               fi
+
+               PS1="${usercol}\u${default}@${hostcol}\h${default}:${pathcol}\w${default}${gitcol}${default}${_p} ${termcmd}"
+       }
+
+       proml
+
+       function rcd () {
+      [ "${1:0:1}" == "/" ] && { cd $1; } || { cd $(pwd -P)/$1; }
+   }
+
+       alias ll="ls -lZ"
+       alias lr="ls -ltrZ"
+       alias la="ls -alZ"
+
+       function get_manifest () {
+               rpm -qa --queryformat="%{name} %{Version} %{Release} %{VCS}\n" | sort
+       }
+fi
+EOF
+
+
+#!/bin/sh
+echo "#################### generic-packaging.post ####################"
+
+rm -rf /root/.zypp
+
+# was: rpm.post
+rm -f /var/lib/rpm/__db*
+rpmdb --rebuilddb
+
+
+#!/bin/sh
+echo "############### common-packaging.post ################"
+
+# generate repo files for zypper
+function genrepo() {
+       local url=$1
+       local reponame=$2
+       local filename=${3:-$2}
+       local enabled=${4:-0}
+
+       local prefix=${TZ_BUILD_VENDOR}-${TZ_BUILD_PROFILE}-${TZ_BUILD_REPO}
+
+       # remove double slashes if any
+       url=$(sed -e  's|/\+|/|g' -e 's|:/|://|' <<<$url)
+
+       cat >> /etc/zypp/repos.d/$prefix-${filename}.repo << EOF
+[$prefix-${reponame}]
+name=$prefix-${reponame}
+enabled=$enabled
+autorefresh=0
+baseurl=${url}?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+}
+
+# source /etc/tizen-build.conf to get more infos about project, repos etc.
+. /etc/tizen-build.conf 
+
+# adjust build_id if this scripts executes before the replacement in /etc/tizen-build.conf
+TZ_BUILD_ID=$(echo $TZ_BUILD_ID | sed 's|@BUILD_ID[@]|tizen-common_20141010.2|')
+
+# snapshot repo
+genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/packages snapshot snapshot 1
+genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/debug snapshot-debug snapshot 1
+
+# latest repo
+genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/packages update update 0
+genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/debug update-debug update 0
+
+# daily repo
+genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/packages daily daily 0
+genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/debug daily-debug daily 0
+
+# weekly repo
+genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/packages weekly weekly 0
+genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/debug weekly-debug weekly 0
+
+
+#!/bin/sh
+echo "#################### generic-adaptation.post ####################"
+
+# fix TIVI-2291
+sed -ri "s/(^blacklist i8042.*$)/#fix from base-general.post \1/" /etc/modprobe.d/blacklist.conf
+
+
+#!/bin/sh
+echo "############### common-adaptation.post ################"
+
+
+#!/bin/sh
+echo "#################### generic-wayland.post ####################"
+
+
+#!/bin/sh
+echo "#################### common-wayland.post ##################"
+
+# add users to display group
+for user in alice bob carol guest; do
+       if generic_base_user_exists $user; then
+               /usr/sbin/groupmod -A $user display
+       fi
+done
+
+# Enable a logind session for users on seat0 (the default seat for
+# graphical sessions)
+unitdir=/usr/lib/systemd/system
+mkdir -p $unitdir/graphical.target.wants
+for user in alice bob carol guest; do
+       generic_base_user_exists $user || continue
+       uid=$(getent passwd $user|cut -f3 -d':')
+       ln -s ../user-session-launch@.service $unitdir/graphical.target.wants/user-session-launch@seat0-$uid.service
+done
+
+# user sessions must start after graphical target
+patch -b -p1 -d/ <<'EOF'
+--- /lib/systemd/system/user-session-launch@.service.orig      2014-03-17 17:50:18.000000000 -0700
++++ /lib/systemd/system/user-session-launch@.service   2014-04-15 06:03:45.555682575 -0700
+@@ -1,7 +1,7 @@
+ [Unit]
+ Description=User Session Launcher
+-After=systemd-user-sessions.service systemd-logind.service
+-Requires=systemd-logind.service
++After=systemd-user-sessions.service systemd-logind.service display-manager.path
++Requires=systemd-logind.service display-manager.path
+ [Service]
+ ExecStart=/usr/bin/user-session-launch %i
+EOF
+
+# clean weston target inside user session (installed by weston)
+rm -f /usr/lib/systemd/user/weston.target
+
+
+#{ Add installed apps for tizen to launcher if not present
+dst="/usr/share/applications/tizen/launcher.conf"
+
+if [ -w "$dst" ] ; then
+   ls /usr/share/applications/tizen/*.desktop \
+   | while read src; do
+        grep "$src" "$dst" \
+            || { [ ! -r "$src" ] || echo "$src" >> "$dst" ; }
+
+    done
+fi
+
+#}
+
+# tag the background image with the current snapshot id
+arch=$(rpm -qa | grep kernel-common | awk -F- '{printf("%s %s",$3,$4);}')
+/usr/bin/mark_image.py /usr/share/backgrounds/tizen/current "Tizen Common: tizen-common_20141010.2 $arch" ffffff 50 90 95 95
+
+
+#!/bin/sh
+echo "#################### generic-middleware.post ####################"
+
+
+#!/bin/sh
+echo "############### common-middleware.post ################"
+
+
+#!/bin/sh
+echo "#################### generic-applications.post ####################"
+
+
+#!/bin/sh
+echo "#################### generic-bluetooth.post ####################"
+
+
+#!/bin/sh
+echo "#################### generic-multimedia.post ####################"
+
+
+#!/bin/sh
+echo "#################### generic-desktop-applications.post ####################"
+
+# temp workaround to fill each user app_info database with global db infos
+. /etc/tizen-platform.conf
+ail_initdb
+pkg_initdb
+
+# depends on generic-base functions
+function generic_desktop_applications_fix_userhome() {
+       user=$1
+
+       generic_base_user_exists $user || return 1
+       homedir=$(generic_base_user_home $user)
+       
+       echo "Fix app_info.db of $user"
+       chown -R $user:users $homedir/.applications/dbspace/
+}
+
+# fix TC-320 for SDK
+. /etc/tizen-build.conf
+[ "${TZ_BUILD_WITH_EMULATOR}" == "1" ] && generic_desktop_applications_fix_userhome developer
+
+
+#!/bin/sh
+echo "############### common-desktop-applications.post ################"
+
+# call function defined in meta-generic
+for user in alice bob carol guest; do
+       generic_desktop_applications_fix_userhome $user
+done
+
+
+
+#!/bin/sh
+echo "#################### generic-crosswalk.post ####################"
+
+# make crosswak start in user session (default target)
+mkdir -p /lib/systemd/user/default.target.wants/
+ln -s ../xwalk.service /lib/systemd/user/default.target.wants/
+
+
+
+#!/bin/sh
+echo "############### common-crosswalk.post ################"
+
+# start wrt widgets preinstall
+prepare_widgets.sh
+
+
+#!/bin/sh
+echo "#################### generic-qt5.post ####################"
+
+
+#!/bin/sh
+echo "############### common-qt5.post ################"
+
+list='
+qt5-qtdeclarative-examples
+qt5-cinematic-experience
+'
+
+dst="/usr/share/applications/tizen/launcher.conf"
+
+if [ -w "$dst" ] ; then
+    for app in $list ; do
+        src="/usr/share/applications/$app.desktop"
+
+        grep "$src" "$dst" \
+            || { [ ! -r "$src" ] || echo "$src" >> "$dst" ; }
+
+    done
+fi
+
+#!/bin/sh
+echo "#################### generic-multimedia-intel.post ####################"
+
+
+
+%end
+
+%post --nochroot
+####################### buildname.nochroot #######################
+if [ -n "$IMG_NAME" ]; then
+       echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+       echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+       echo "$IMG_NAME tizen-common_20141010.2" >>$INSTALL_ROOT/etc/tizen-snapshot
+
+       sed -ri \
+               -e 's|@BUILD_ID[@]|tizen-common_20141010.2|g' \
+               -e "s|@BUILD_DATE[@]|$(date +%Y%m%d_%H%M%S)|g" \
+               $INSTALL_ROOT/etc/tizen-build.conf
+fi
+
+
+%end
diff --git a/fixtures/ks_files/error_auto.ks b/fixtures/ks_files/error_auto.ks
new file mode 100644 (file)
index 0000000..2345615
--- /dev/null
@@ -0,0 +1,164 @@
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --size 1624 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5"   
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+
+%packages
+
+@Medfield Support
+@common
+@appscommon
+@appstargetsdk
+@appsref
+@osp
+@trats-blackbay
+
+
+pvr-bin-mdfld
+-charging-animation
+%end
+
+%prepackages
+eglibc
+systemd
+busybox
+libacl
+libcap
+dbus-libs
+libgcc
+libudev
+libattr
+default-files-slp
+openssl
+libprivilege-control
+libprivilege-control-conf
+security-server
+libdlog
+libsecurity-server-client
+sqlite
+tzdata-slp
+vconf
+tizen-coreutils
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+echo 'kickstart post script start'
+if [ -d /etc/init.d ]; then
+    cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
+fi
+rm -rf /etc/init.d*
+ln -sf /etc/rc.d/init.d /etc/init.d
+
+rm -rf /etc/localtime  
+ln -sf /opt/etc/localtime /etc/localtime  
+#rm -rf /usr/share/zoneinfo  
+#ln -sf /opt/share/zoneinfo /usr/share/zoneinfo 
+
+# Without this line the rpm don't get the architecture right.
+echo -n 'armv7l-tizen-linux' > /etc/rpm/platform
+
+ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
+ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
+ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
+
+pkg_initdb
+
+INITDB=1 ail_initdb
+/opt/apps/com.samsung.menu-screen/bin/menuscreen_initdb
+
+# ims-service domain setting
+RESULT=`grep "192.168.0.163 config.45001.rcse" /etc/hosts`  
+if [ -z "$RESULT" ]; then  
+    echo "Set domain for auto configuration"  
+    echo "192.168.0.163 config.45001.rcse" >> /etc/hosts  
+else  
+    echo "Already setted domain for test auto configuration"  
+fi  
+# ims-service domain setting
+
+cat > /usr/bin/press << EOF
+#!/bin/sh
+
+JUNK="SLP"
+
+[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
+
+echo "Press return key to stop scripts"
+read -t \$TIMEOUT JUNK
+exit \$?
+EOF
+chmod +x /usr/bin/press
+
+# [systemd] we need suid-root X for it to work from user-session
+#           Xorg will move to system, so this is temporary
+chmod 4755 /usr/bin/Xorg
+
+ln -s /opt/etc/X11/xkb /usr/share/X11
+
+echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
+
+rm -rf /usr/include
+rm -rf /usr/share/man
+rm -rf /usr/share/doc
+
+ldconfig
+
+mkdir -p /opt/var/lib/dbus
+
+
+# read-writeable /var will be bind-mounted to /opt/var leaving rootfs read-only
+# below script more generic
+
+rm -f /var/lib/rpm/__db*
+rpm --rebuilddb
+cp -a /var /opt/
+rm -rf /var
+mkdir /var
+
+
+# [systemd] some firstboot script like kbd could be done to image-creatation stage
+#           this patch is for it.
+for i in /etc/preconf.d/*; do
+    $i
+done
+
+if [ -e /usr/bin/build-backup-data.sh ]; then
+           /usr/bin/build-backup-data.sh
+fi
+
+/etc/make_info_file.sh Ref.Device-210 Tizen_Ref.Device-210_`date +%Y%m%d.%H%M`
+
+ln -sf /etc/info.ini /opt/etc/info.ini
+ln -sf /etc/info.ini /usr/etc/info.ini
+
+echo "s1:12345:respawn:/sbin/agetty -L 115200 ttyMFD3 vt100" >> /etc/inittab
+
+
+%end
+
+%post --nochroot
+
+%end
+
diff --git a/fixtures/ks_files/error_ks_with_chinese.ks b/fixtures/ks_files/error_ks_with_chinese.ks
new file mode 100644 (file)
index 0000000..65b2865
--- /dev/null
@@ -0,0 +1,165 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --size 1624 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5"   
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+
+%packages
+
+@Medfield Support
+@common
+@appscommon
+@appstargetsdk
+@appsref
+@osp
+@trats-blackbay
+你好
+
+pvr-bin-mdfld
+-charging-animation
+%end
+
+%prepackages
+eglibc
+systemd
+busybox
+libacl
+libcap
+dbus-libs
+libgcc
+libudev
+libattr
+default-files-slp
+openssl
+libprivilege-control
+libprivilege-control-conf
+security-server
+libdlog
+libsecurity-server-client
+sqlite
+tzdata-slp
+vconf
+tizen-coreutils
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+echo 'kickstart post script start'
+if [ -d /etc/init.d ]; then
+    cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
+fi
+rm -rf /etc/init.d*
+ln -sf /etc/rc.d/init.d /etc/init.d
+
+rm -rf /etc/localtime  
+ln -sf /opt/etc/localtime /etc/localtime  
+#rm -rf /usr/share/zoneinfo  
+#ln -sf /opt/share/zoneinfo /usr/share/zoneinfo 
+
+# Without this line the rpm don't get the architecture right.
+echo -n 'armv7l-tizen-linux' > /etc/rpm/platform
+
+ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
+ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
+ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
+
+pkg_initdb
+
+INITDB=1 ail_initdb
+/opt/apps/com.samsung.menu-screen/bin/menuscreen_initdb
+
+# ims-service domain setting
+RESULT=`grep "192.168.0.163 config.45001.rcse" /etc/hosts`  
+if [ -z "$RESULT" ]; then  
+    echo "Set domain for auto configuration"  
+    echo "192.168.0.163 config.45001.rcse" >> /etc/hosts  
+else  
+    echo "Already setted domain for test auto configuration"  
+fi  
+# ims-service domain setting
+
+cat > /usr/bin/press << EOF
+#!/bin/sh
+
+JUNK="SLP"
+
+[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
+
+echo "Press return key to stop scripts"
+read -t \$TIMEOUT JUNK
+exit \$?
+EOF
+chmod +x /usr/bin/press
+
+# [systemd] we need suid-root X for it to work from user-session
+#           Xorg will move to system, so this is temporary
+chmod 4755 /usr/bin/Xorg
+
+ln -s /opt/etc/X11/xkb /usr/share/X11
+
+echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
+
+rm -rf /usr/include
+rm -rf /usr/share/man
+rm -rf /usr/share/doc
+
+ldconfig
+
+mkdir -p /opt/var/lib/dbus
+
+
+# read-writeable /var will be bind-mounted to /opt/var leaving rootfs read-only
+# below script more generic
+
+rm -f /var/lib/rpm/__db*
+rpm --rebuilddb
+cp -a /var /opt/
+rm -rf /var
+mkdir /var
+
+
+# [systemd] some firstboot script like kbd could be done to image-creatation stage
+#           this patch is for it.
+for i in /etc/preconf.d/*; do
+    $i
+done
+
+if [ -e /usr/bin/build-backup-data.sh ]; then
+           /usr/bin/build-backup-data.sh
+fi
+
+/etc/make_info_file.sh Ref.Device-210 Tizen_Ref.Device-210_`date +%Y%m%d.%H%M`
+
+ln -sf /etc/info.ini /opt/etc/info.ini
+ln -sf /etc/info.ini /usr/etc/info.ini
+
+echo "s1:12345:respawn:/sbin/agetty -L 115200 ttyMFD3 vt100" >> /etc/inittab
+
+
+%end
+
+%post --nochroot
+
+%end
+
diff --git a/fixtures/ks_files/error_no_package.ks b/fixtures/ks_files/error_no_package.ks
new file mode 100644 (file)
index 0000000..2fa73b6
--- /dev/null
@@ -0,0 +1,120 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --size 1624 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5"   
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+
+%post
+echo 'kickstart post script start'
+if [ -d /etc/init.d ]; then
+    cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
+fi
+rm -rf /etc/init.d*
+ln -sf /etc/rc.d/init.d /etc/init.d
+
+rm -rf /etc/localtime  
+ln -sf /opt/etc/localtime /etc/localtime  
+#rm -rf /usr/share/zoneinfo  
+#ln -sf /opt/share/zoneinfo /usr/share/zoneinfo 
+
+# Without this line the rpm don't get the architecture right.
+echo -n 'armv7l-tizen-linux' > /etc/rpm/platform
+
+ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
+ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
+ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
+
+pkg_initdb
+
+INITDB=1 ail_initdb
+/opt/apps/com.samsung.menu-screen/bin/menuscreen_initdb
+
+# ims-service domain setting
+RESULT=`grep "192.168.0.163 config.45001.rcse" /etc/hosts`  
+if [ -z "$RESULT" ]; then  
+    echo "Set domain for auto configuration"  
+    echo "192.168.0.163 config.45001.rcse" >> /etc/hosts  
+else  
+    echo "Already setted domain for test auto configuration"  
+fi  
+# ims-service domain setting
+
+cat > /usr/bin/press << EOF
+#!/bin/sh
+
+JUNK="SLP"
+
+[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
+
+echo "Press return key to stop scripts"
+read -t \$TIMEOUT JUNK
+exit \$?
+EOF
+chmod +x /usr/bin/press
+
+# [systemd] we need suid-root X for it to work from user-session
+#           Xorg will move to system, so this is temporary
+chmod 4755 /usr/bin/Xorg
+
+ln -s /opt/etc/X11/xkb /usr/share/X11
+
+echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
+
+rm -rf /usr/include
+rm -rf /usr/share/man
+rm -rf /usr/share/doc
+
+ldconfig
+
+mkdir -p /opt/var/lib/dbus
+
+
+# read-writeable /var will be bind-mounted to /opt/var leaving rootfs read-only
+# below script more generic
+
+rm -f /var/lib/rpm/__db*
+rpm --rebuilddb
+cp -a /var /opt/
+rm -rf /var
+mkdir /var
+
+
+# [systemd] some firstboot script like kbd could be done to image-creatation stage
+#           this patch is for it.
+for i in /etc/preconf.d/*; do
+    $i
+done
+
+if [ -e /usr/bin/build-backup-data.sh ]; then
+           /usr/bin/build-backup-data.sh
+fi
+
+/etc/make_info_file.sh Ref.Device-210 Tizen_Ref.Device-210_`date +%Y%m%d.%H%M`
+
+ln -sf /etc/info.ini /opt/etc/info.ini
+ln -sf /etc/info.ini /usr/etc/info.ini
+
+echo "s1:12345:respawn:/sbin/agetty -L 115200 ttyMFD3 vt100" >> /etc/inittab
+
+
+%end
+
+%post --nochroot
+
+%end
+
diff --git a/fixtures/ks_files/error_no_repo.ks b/fixtures/ks_files/error_no_repo.ks
new file mode 100644 (file)
index 0000000..5fb9f16
--- /dev/null
@@ -0,0 +1,162 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --size 1624 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5"   
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+%packages
+
+@Medfield Support
+@common
+@appscommon
+@appstargetsdk
+@appsref
+@osp
+@trats-blackbay
+
+
+pvr-bin-mdfld
+-charging-animation
+%end
+
+%prepackages
+eglibc
+systemd
+busybox
+libacl
+libcap
+dbus-libs
+libgcc
+libudev
+libattr
+default-files-slp
+openssl
+libprivilege-control
+libprivilege-control-conf
+security-server
+libdlog
+libsecurity-server-client
+sqlite
+tzdata-slp
+vconf
+tizen-coreutils
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+echo 'kickstart post script start'
+if [ -d /etc/init.d ]; then
+    cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
+fi
+rm -rf /etc/init.d*
+ln -sf /etc/rc.d/init.d /etc/init.d
+
+rm -rf /etc/localtime  
+ln -sf /opt/etc/localtime /etc/localtime  
+#rm -rf /usr/share/zoneinfo  
+#ln -sf /opt/share/zoneinfo /usr/share/zoneinfo 
+
+# Without this line the rpm don't get the architecture right.
+echo -n 'armv7l-tizen-linux' > /etc/rpm/platform
+
+ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
+ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
+ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
+
+pkg_initdb
+
+INITDB=1 ail_initdb
+/opt/apps/com.samsung.menu-screen/bin/menuscreen_initdb
+
+# ims-service domain setting
+RESULT=`grep "192.168.0.163 config.45001.rcse" /etc/hosts`  
+if [ -z "$RESULT" ]; then  
+    echo "Set domain for auto configuration"  
+    echo "192.168.0.163 config.45001.rcse" >> /etc/hosts  
+else  
+    echo "Already setted domain for test auto configuration"  
+fi  
+# ims-service domain setting
+
+cat > /usr/bin/press << EOF
+#!/bin/sh
+
+JUNK="SLP"
+
+[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
+
+echo "Press return key to stop scripts"
+read -t \$TIMEOUT JUNK
+exit \$?
+EOF
+chmod +x /usr/bin/press
+
+# [systemd] we need suid-root X for it to work from user-session
+#           Xorg will move to system, so this is temporary
+chmod 4755 /usr/bin/Xorg
+
+ln -s /opt/etc/X11/xkb /usr/share/X11
+
+echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
+
+rm -rf /usr/include
+rm -rf /usr/share/man
+rm -rf /usr/share/doc
+
+ldconfig
+
+mkdir -p /opt/var/lib/dbus
+
+
+# read-writeable /var will be bind-mounted to /opt/var leaving rootfs read-only
+# below script more generic
+
+rm -f /var/lib/rpm/__db*
+rpm --rebuilddb
+cp -a /var /opt/
+rm -rf /var
+mkdir /var
+
+
+# [systemd] some firstboot script like kbd could be done to image-creatation stage
+#           this patch is for it.
+for i in /etc/preconf.d/*; do
+    $i
+done
+
+if [ -e /usr/bin/build-backup-data.sh ]; then
+           /usr/bin/build-backup-data.sh
+fi
+
+/etc/make_info_file.sh Ref.Device-210 Tizen_Ref.Device-210_`date +%Y%m%d.%H%M`
+
+ln -sf /etc/info.ini /opt/etc/info.ini
+ln -sf /etc/info.ini /usr/etc/info.ini
+
+echo "s1:12345:respawn:/sbin/agetty -L 115200 ttyMFD3 vt100" >> /etc/inittab
+
+
+%end
+
+%post --nochroot
+
+%end
+
diff --git a/fixtures/ks_files/error_package.ks b/fixtures/ks_files/error_package.ks
new file mode 100644 (file)
index 0000000..520d2b2
--- /dev/null
@@ -0,0 +1,166 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --size 1624 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5"   
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+
+%packages
+
+@Medfield Support
+@common
+@appscommon
+@appstargetsdk
+@appsref
+@osp
+@trats-blackbay
+
+hg
+svn
+pvr-bin-mdfld
+-charging-animation
+%end
+
+%prepackages
+eglibc
+systemd
+busybox
+libacl
+libcap
+dbus-libs
+libgcc
+libudev
+libattr
+default-files-slp
+openssl
+libprivilege-control
+libprivilege-control-conf
+security-server
+libdlog
+libsecurity-server-client
+sqlite
+tzdata-slp
+vconf
+tizen-coreutils
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+echo 'kickstart post script start'
+if [ -d /etc/init.d ]; then
+    cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
+fi
+rm -rf /etc/init.d*
+ln -sf /etc/rc.d/init.d /etc/init.d
+
+rm -rf /etc/localtime  
+ln -sf /opt/etc/localtime /etc/localtime  
+#rm -rf /usr/share/zoneinfo  
+#ln -sf /opt/share/zoneinfo /usr/share/zoneinfo 
+
+# Without this line the rpm don't get the architecture right.
+echo -n 'armv7l-tizen-linux' > /etc/rpm/platform
+
+ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
+ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
+ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
+
+pkg_initdb
+
+INITDB=1 ail_initdb
+/opt/apps/com.samsung.menu-screen/bin/menuscreen_initdb
+
+# ims-service domain setting
+RESULT=`grep "192.168.0.163 config.45001.rcse" /etc/hosts`  
+if [ -z "$RESULT" ]; then  
+    echo "Set domain for auto configuration"  
+    echo "192.168.0.163 config.45001.rcse" >> /etc/hosts  
+else  
+    echo "Already setted domain for test auto configuration"  
+fi  
+# ims-service domain setting
+
+cat > /usr/bin/press << EOF
+#!/bin/sh
+
+JUNK="SLP"
+
+[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
+
+echo "Press return key to stop scripts"
+read -t \$TIMEOUT JUNK
+exit \$?
+EOF
+chmod +x /usr/bin/press
+
+# [systemd] we need suid-root X for it to work from user-session
+#           Xorg will move to system, so this is temporary
+chmod 4755 /usr/bin/Xorg
+
+ln -s /opt/etc/X11/xkb /usr/share/X11
+
+echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
+
+rm -rf /usr/include
+rm -rf /usr/share/man
+rm -rf /usr/share/doc
+
+ldconfig
+
+mkdir -p /opt/var/lib/dbus
+
+
+# read-writeable /var will be bind-mounted to /opt/var leaving rootfs read-only
+# below script more generic
+
+rm -f /var/lib/rpm/__db*
+rpm --rebuilddb
+cp -a /var /opt/
+rm -rf /var
+mkdir /var
+
+
+# [systemd] some firstboot script like kbd could be done to image-creatation stage
+#           this patch is for it.
+for i in /etc/preconf.d/*; do
+    $i
+done
+
+if [ -e /usr/bin/build-backup-data.sh ]; then
+           /usr/bin/build-backup-data.sh
+fi
+
+/etc/make_info_file.sh Ref.Device-210 Tizen_Ref.Device-210_`date +%Y%m%d.%H%M`
+
+ln -sf /etc/info.ini /opt/etc/info.ini
+ln -sf /etc/info.ini /usr/etc/info.ini
+
+echo "s1:12345:respawn:/sbin/agetty -L 115200 ttyMFD3 vt100" >> /etc/inittab
+
+
+%end
+
+%post --nochroot
+
+%end
+
diff --git a/fixtures/ks_files/error_repo.ks b/fixtures/ks_files/error_repo.ks
new file mode 100644 (file)
index 0000000..cb156a8
--- /dev/null
@@ -0,0 +1,165 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --size 1624 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5"   
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/download.tizendev.org/not-exists/ --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/download.tizendev.org/not-exist/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+
+@Medfield Support
+@common
+@appscommon
+@appstargetsdk
+@appsref
+@osp
+@trats-blackbay
+
+
+pvr-bin-mdfld
+-charging-animation
+%end
+
+%prepackages
+eglibc
+systemd
+busybox
+libacl
+libcap
+dbus-libs
+libgcc
+libudev
+libattr
+default-files-slp
+openssl
+libprivilege-control
+libprivilege-control-conf
+security-server
+libdlog
+libsecurity-server-client
+sqlite
+tzdata-slp
+vconf
+tizen-coreutils
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+echo 'kickstart post script start'
+if [ -d /etc/init.d ]; then
+    cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
+fi
+rm -rf /etc/init.d*
+ln -sf /etc/rc.d/init.d /etc/init.d
+
+rm -rf /etc/localtime  
+ln -sf /opt/etc/localtime /etc/localtime  
+#rm -rf /usr/share/zoneinfo  
+#ln -sf /opt/share/zoneinfo /usr/share/zoneinfo 
+
+# Without this line the rpm don't get the architecture right.
+echo -n 'armv7l-tizen-linux' > /etc/rpm/platform
+
+ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
+ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
+ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
+
+pkg_initdb
+
+INITDB=1 ail_initdb
+/opt/apps/com.samsung.menu-screen/bin/menuscreen_initdb
+
+# ims-service domain setting
+RESULT=`grep "192.168.0.163 config.45001.rcse" /etc/hosts`  
+if [ -z "$RESULT" ]; then  
+    echo "Set domain for auto configuration"  
+    echo "192.168.0.163 config.45001.rcse" >> /etc/hosts  
+else  
+    echo "Already setted domain for test auto configuration"  
+fi  
+# ims-service domain setting
+
+cat > /usr/bin/press << EOF
+#!/bin/sh
+
+JUNK="SLP"
+
+[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
+
+echo "Press return key to stop scripts"
+read -t \$TIMEOUT JUNK
+exit \$?
+EOF
+chmod +x /usr/bin/press
+
+# [systemd] we need suid-root X for it to work from user-session
+#           Xorg will move to system, so this is temporary
+chmod 4755 /usr/bin/Xorg
+
+ln -s /opt/etc/X11/xkb /usr/share/X11
+
+echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
+
+rm -rf /usr/include
+rm -rf /usr/share/man
+rm -rf /usr/share/doc
+
+ldconfig
+
+mkdir -p /opt/var/lib/dbus
+
+
+# read-writeable /var will be bind-mounted to /opt/var leaving rootfs read-only
+# below script more generic
+
+rm -f /var/lib/rpm/__db*
+rpm --rebuilddb
+cp -a /var /opt/
+rm -rf /var
+mkdir /var
+
+
+# [systemd] some firstboot script like kbd could be done to image-creatation stage
+#           this patch is for it.
+for i in /etc/preconf.d/*; do
+    $i
+done
+
+if [ -e /usr/bin/build-backup-data.sh ]; then
+           /usr/bin/build-backup-data.sh
+fi
+
+/etc/make_info_file.sh Ref.Device-210 Tizen_Ref.Device-210_`date +%Y%m%d.%H%M`
+
+ln -sf /etc/info.ini /opt/etc/info.ini
+ln -sf /etc/info.ini /usr/etc/info.ini
+
+echo "s1:12345:respawn:/sbin/agetty -L 115200 ttyMFD3 vt100" >> /etc/inittab
+
+
+%end
+
+%post --nochroot
+
+%end
+
diff --git a/fixtures/ks_files/gnome-live-gpt.ks b/fixtures/ks_files/gnome-live-gpt.ks
new file mode 100644 (file)
index 0000000..254b24f
--- /dev/null
@@ -0,0 +1,24 @@
+# -*-mic2-options-*- -f liveusb --copy-kernel --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 512 --ondisk sda --fstype=ext3
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=1  --append="vga=current quiet splash"  --ptable=gpt
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=pc --baseurl=http://repo-vm.bj.intel.com/download.tz.otcshare.org/pc/tizen-pc_20121221.9/repos/pc/ia32/packages/ --gpgkey=0 --ssl_verify=no
+
+%packages
+
+coreutils
+bash
+kernel-adaptation-pc
+
+%end
diff --git a/fixtures/ks_files/gnome-live-label.ks b/fixtures/ks_files/gnome-live-label.ks
new file mode 100644 (file)
index 0000000..b87c276
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-mic2-options-*- -f liveusb --copy-kernel --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 512 --ondisk sda --fstype=ext3 --label=platform
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=1  --append="vga=current quiet splash"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=pc --baseurl=http://linux-ftp.fi.intel.com/repo-tizen-pc_20130716.3/repos/pc/ia32/packages --gpgkey=0 --ssl_verify=no
+
+
+%packages
+
+coreutils
+bash
+kernel-adaptation-pc
+
+%end
diff --git a/fixtures/ks_files/gnome-live.ks b/fixtures/ks_files/gnome-live.ks
new file mode 100644 (file)
index 0000000..3e0dcb1
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-mic2-options-*- -f liveusb --copy-kernel --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 512 --ondisk sda --fstype=ext3
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=1  --append="vga=current quiet splash"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=pc --baseurl=http://linux-ftp.fi.intel.com/repo-tizen-pc_20130716.3/repos/pc/ia32/packages --gpgkey=0 --ssl_verify=no
+
+
+%packages
+
+coreutils
+bash
+kernel-adaptation-pc
+
+%end
diff --git a/fixtures/ks_files/gnome_exclude.ks b/fixtures/ks_files/gnome_exclude.ks
new file mode 100644 (file)
index 0000000..4f81b7e
--- /dev/null
@@ -0,0 +1,125 @@
+# -*-mic2-options-*- -f liveusb --copy-kernel --runtime=native -*-mic2-options-*-
+
+#
+# Do not Edit! Generated by:
+# kickstarter.py
+#
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --size 3200 --ondisk sda --fstype=ext3 --active
+
+bootloader  --timeout=10  --append="vga=current quiet splash"   --menus="install:Wipe and Install:systemd.unit=pc-installer.service:test"
+
+repo --name=pc --baseurl=http://linux-ftp.fi.intel.com/repo-tizen-pc_20130716.3/repos/pc/ia32/packages/ --ssl_verify=no --excludepkgs=wrt-devel,wrt-installer,wrt-plugins-tizen,xhost
+repo --name=pc-wrt --baseurl=http://linux-ftp.fi.intel.com/repo-tizen-pc_20130716.3/repos/pc-wrt/ia32/packages/ --ssl_verify=no
+repo --name=pc-internal --baseurl=http://linux-ftp.fi.intel.com/repo-tizen-pc_20130716.3/repos/pc-internal/ia32/packages/ --ssl_verify=no
+
+%packages
+wrt
+kernel-adaptation-pc
+wrt-installer
+wrt-plugins-tizen
+wrt-devel
+@Base Desktop
+-xhost
+%end
+
+%post
+
+# Migrate /etc/sysconfig/i18n until MIC is fixed to handle locale.conf
+#
+if [ -e /etc/sysconfig/i18n -a ! -e /etc/locale.conf ]; then
+        unset LANG
+        unset LC_CTYPE
+        unset LC_NUMERIC
+        unset LC_TIME
+        unset LC_COLLATE
+        unset LC_MONETARY
+        unset LC_MESSAGES
+        unset LC_PAPER
+        unset LC_NAME
+        unset LC_ADDRESS
+        unset LC_TELEPHONE
+        unset LC_MEASUREMENT
+        unset LC_IDENTIFICATION
+        . /etc/sysconfig/i18n >/dev/null 2>&1 || :
+        [ -n "$LANG" ] && echo LANG=$LANG > /etc/locale.conf 2>&1 || :
+        [ -n "$LC_CTYPE" ] && echo LC_CTYPE=$LC_CTYPE >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_NUMERIC" ] && echo LC_NUMERIC=$LC_NUMERIC >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_TIME" ] && echo LC_TIME=$LC_TIME >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_COLLATE" ] && echo LC_COLLATE=$LC_COLLATE >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_MONETARY" ] && echo LC_MONETARY=$LC_MONETARY >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_MESSAGES" ] && echo LC_MESSAGES=$LC_MESSAGES >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_PAPER" ] && echo LC_PAPER=$LC_PAPER >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_NAME" ] && echo LC_NAME=$LC_NAME >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_ADDRESS" ] && echo LC_ADDRESS=$LC_ADDRESS >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_TELEPHONE" ] && echo LC_TELEPHONE=$LC_TELEPHONE >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_MEASUREMENT" ] && echo LC_MEASUREMENT=$LC_MEASUREMENT >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_IDENTIFICATION" ] && echo LC_IDENTIFICATION=$LC_IDENTIFICATION >> /etc/locale.conf 2>&1 || :
+fi
+rm -f /etc/sysconfig/i18n >/dev/null 2>&1 || :
+
+
+
+
+cat >> /etc/zypp/repos.d/tizen-pc-daily.repo  << EOF
+[pc]
+name=pc
+enabled=1
+autorefresh=0
+baseurl=https://download.tz.otcshare.org/releases/daily/trunk/pc/latest/repos/pc/x86_64/packages/?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+
+cat >> /etc/zypp/repos.d/tizen-pc-daily-internal.repo  << EOF
+[pc-internal]
+name=pc-internal
+enabled=1
+autorefresh=0
+baseurl=https://download.tz.otcshare.org/releases/daily/trunk/pc/latest/repos/pc-internal/x86_64/packages/?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+
+cat >> /etc/zypp/repos.d/tizen-pc-daily-wrt.repo  << EOF
+[pc-wrt]
+name=pc-wrt
+enabled=1
+autorefresh=0
+baseurl=https://download.tz.otcshare.org/releases/daily/trunk/pc/latest/repos/pc-wrt/x86_64/packages/?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+
+cat >> /etc/zypp/repos.d/google.repo  << EOF
+[google]
+name=google
+enabled=1
+autorefresh=0
+baseurl=https://download.tz.otcshare.org/3rdparty/repos/pc/google/?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+
+ln -sf /proc/self/mounts /etc/mtab
+
+
+rm -rf /root/.zypp
+
+cat >> /etc/os-release  << EOF
+BUILD_ID=@BUILD_ID@
+EOF
+
+ln -sf /usr/share/plymouth/themes/tizen/tizen-installer.script /usr/share/plymouth/themes/tizen/tizen.script
+
+passwd -l root
+
+
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/gnome_include.ks b/fixtures/ks_files/gnome_include.ks
new file mode 100644 (file)
index 0000000..36ceeb1
--- /dev/null
@@ -0,0 +1,123 @@
+# -*-mic2-options-*- -f liveusb --copy-kernel --runtime=native -*-mic2-options-*-
+
+#
+# Do not Edit! Generated by:
+# kickstarter.py
+#
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --size 3200 --ondisk sda --fstype=ext3 --active
+
+bootloader  --timeout=10  --append="vga=current quiet splash"   --menus="install:Wipe and Install:systemd.unit=pc-installer.service:test"
+
+repo --name=pc --baseurl=http://linux-ftp.fi.intel.com/repo-tizen-pc_20130716.3/repos/pc/ia32/packages/ --ssl_verify=no --includepkgs=wrt-devel
+repo --name=pc-wrt --baseurl=http://linux-ftp.fi.intel.com/repo-tizen-pc_20130716.3/repos/pc-wrt/ia32/packages/ --ssl_verify=no --includepkgs=wrt-installer
+repo --name=pc-internal --baseurl=http://linux-ftp.fi.intel.com/repo-tizen-pc_20130716.3/repos/pc-internal/ia32/packages/ --ssl_verify=no
+
+%packages
+wrt
+kernel-adaptation-pc
+wrt-devel
+wrt-installer
+wrt-plugins-tizen
+%end
+
+%post
+
+# Migrate /etc/sysconfig/i18n until MIC is fixed to handle locale.conf
+#
+if [ -e /etc/sysconfig/i18n -a ! -e /etc/locale.conf ]; then
+        unset LANG
+        unset LC_CTYPE
+        unset LC_NUMERIC
+        unset LC_TIME
+        unset LC_COLLATE
+        unset LC_MONETARY
+        unset LC_MESSAGES
+        unset LC_PAPER
+        unset LC_NAME
+        unset LC_ADDRESS
+        unset LC_TELEPHONE
+        unset LC_MEASUREMENT
+        unset LC_IDENTIFICATION
+        . /etc/sysconfig/i18n >/dev/null 2>&1 || :
+        [ -n "$LANG" ] && echo LANG=$LANG > /etc/locale.conf 2>&1 || :
+        [ -n "$LC_CTYPE" ] && echo LC_CTYPE=$LC_CTYPE >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_NUMERIC" ] && echo LC_NUMERIC=$LC_NUMERIC >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_TIME" ] && echo LC_TIME=$LC_TIME >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_COLLATE" ] && echo LC_COLLATE=$LC_COLLATE >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_MONETARY" ] && echo LC_MONETARY=$LC_MONETARY >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_MESSAGES" ] && echo LC_MESSAGES=$LC_MESSAGES >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_PAPER" ] && echo LC_PAPER=$LC_PAPER >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_NAME" ] && echo LC_NAME=$LC_NAME >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_ADDRESS" ] && echo LC_ADDRESS=$LC_ADDRESS >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_TELEPHONE" ] && echo LC_TELEPHONE=$LC_TELEPHONE >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_MEASUREMENT" ] && echo LC_MEASUREMENT=$LC_MEASUREMENT >> /etc/locale.conf 2>&1 || :
+        [ -n "$LC_IDENTIFICATION" ] && echo LC_IDENTIFICATION=$LC_IDENTIFICATION >> /etc/locale.conf 2>&1 || :
+fi
+rm -f /etc/sysconfig/i18n >/dev/null 2>&1 || :
+
+
+
+
+cat >> /etc/zypp/repos.d/tizen-pc-daily.repo  << EOF
+[pc]
+name=pc
+enabled=1
+autorefresh=0
+baseurl=https://download.tz.otcshare.org/releases/daily/trunk/pc/latest/repos/pc/x86_64/packages/?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+
+cat >> /etc/zypp/repos.d/tizen-pc-daily-internal.repo  << EOF
+[pc-internal]
+name=pc-internal
+enabled=1
+autorefresh=0
+baseurl=https://download.tz.otcshare.org/releases/daily/trunk/pc/latest/repos/pc-internal/x86_64/packages/?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+
+cat >> /etc/zypp/repos.d/tizen-pc-daily-wrt.repo  << EOF
+[pc-wrt]
+name=pc-wrt
+enabled=1
+autorefresh=0
+baseurl=https://download.tz.otcshare.org/releases/daily/trunk/pc/latest/repos/pc-wrt/x86_64/packages/?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+
+cat >> /etc/zypp/repos.d/google.repo  << EOF
+[google]
+name=google
+enabled=1
+autorefresh=0
+baseurl=https://download.tz.otcshare.org/3rdparty/repos/pc/google/?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+
+ln -sf /proc/self/mounts /etc/mtab
+
+
+rm -rf /root/.zypp
+
+cat >> /etc/os-release  << EOF
+BUILD_ID=@BUILD_ID@
+EOF
+
+ln -sf /usr/share/plymouth/themes/tizen/tizen-installer.script /usr/share/plymouth/themes/tizen/tizen.script
+
+passwd -l root
+
+
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/handset_blackbay.ks b/fixtures/ks_files/handset_blackbay.ks
new file mode 100644 (file)
index 0000000..37c97e8
--- /dev/null
@@ -0,0 +1,43 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 848 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5 security=none"
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-base-source --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/source/ --save --source --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main-source --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/source/ --save --source --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+kernel*
+rpm
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/handset_blackbay_fs.ks b/fixtures/ks_files/handset_blackbay_fs.ks
new file mode 100644 (file)
index 0000000..0ca2190
--- /dev/null
@@ -0,0 +1,40 @@
+# -*-mic2-options-*- -f fs --pack-to=@NAME@-rs.tar.gz -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 448 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+kernel*
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/handset_blackbay_localrepo.ks b/fixtures/ks_files/handset_blackbay_localrepo.ks
new file mode 100644 (file)
index 0000000..6e64651
--- /dev/null
@@ -0,0 +1,22 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 448 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=local_base --baseurl=file:///home/build/tmp/mic/cache/packages/Tizen-base/
+repo --name=local_main --baseurl=file:///home/build/tmp/mic/cache/packages/Tizen-main/
+
+%packages
+coreutils
+bash
+kernel*
+%end
diff --git a/fixtures/ks_files/handset_blackbay_localrepo_test.ks b/fixtures/ks_files/handset_blackbay_localrepo_test.ks
new file mode 100644 (file)
index 0000000..f78838f
--- /dev/null
@@ -0,0 +1,22 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 448 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=local_base --baseurl=file:///home/build/tmp/mic/cache/packages/Tizen-base/
+#repo --name=local_main --baseurl=file:///home/build/tmp/mic/cache/packages/Tizen-main/
+
+%packages
+coreutils
+bash
+kernel*
+%end
diff --git a/fixtures/ks_files/handset_blackbay_no_mountpoint.ks b/fixtures/ks_files/handset_blackbay_no_mountpoint.ks
new file mode 100644 (file)
index 0000000..0ddd1a3
--- /dev/null
@@ -0,0 +1,42 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#part / --size 448 --ondisk sda --fstype=ext3 --label platform
+part  --size 448 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen 
+bootloader  --timeout=0  --append="rootdelay=5"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+kernel*
+rpm
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/handset_blackbay_priority.ks b/fixtures/ks_files/handset_blackbay_priority.ks
new file mode 100644 (file)
index 0000000..6c00411
--- /dev/null
@@ -0,0 +1,44 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 448 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=tmp --baseurl=file:///home/build/tmp1/  --priority=1
+repo --name=tmp2 --baseurl=file:///home/build/tmp2/ --priority=2
+
+%packages
+coreutils
+bash
+kernel*
+rpm
+fake
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/handset_blackbay_test_repo.ks b/fixtures/ks_files/handset_blackbay_test_repo.ks
new file mode 100644 (file)
index 0000000..b09c543
--- /dev/null
@@ -0,0 +1,43 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 848 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5 security=none"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+#repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+#repo --name=Tizen-base-source --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/source/ --save --source --gpgkey=0 --ssl_verify=no
+#repo --name=Tizen-main-source --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/source/ --save --source --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+kernel*
+rpm
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/handset_blackbay_with_encoded_passwd.ks b/fixtures/ks_files/handset_blackbay_with_encoded_passwd.ks
new file mode 100644 (file)
index 0000000..8b0874d
--- /dev/null
@@ -0,0 +1,50 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 448 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5 security=none"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=https://testspec:pass%40%2C%3A%25@linux-ftp.fi.intel.com/repo-protected/tizen/releases/2.2/latest/repos/tizen-base/ia32/packages/ --ssl_verify=no
+repo --name=Tizen-main --baseurl=https://testspec:pass%40%2C%3A%25@linux-ftp.fi.intel.com/repo-protected/tizen/releases/2.2/latest/repos/tizen-main/ia32/packages/ --save  --ssl_verify=no
+
+%pre
+echo 'helo'
+mkdir -p ~/lhh
+%end
+
+%prepackages
+bash
+%end
+
+%packages
+coreutils
+bash
+kernel*
+rpm
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/handset_blackbay_with_passwd.ks b/fixtures/ks_files/handset_blackbay_with_passwd.ks
new file mode 100644 (file)
index 0000000..b7e0144
--- /dev/null
@@ -0,0 +1,41 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 448 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5 security=none"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://test:123456@linux-ftp.fi.intel.com/repo-protected/tizen/releases/2.2/latest/repos/tizen-base/ia32/packages/ --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://test:123456@linux-ftp.fi.intel.com/repo-protected/tizen/releases/2.2/latest/repos/tizen-main/ia32/packages/ --save  --ssl_verify=no
+
+%packages
+coreutils
+bash
+kernel*
+rpm
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/handset_blackbay_with_separate_passwd.ks b/fixtures/ks_files/handset_blackbay_with_separate_passwd.ks
new file mode 100644 (file)
index 0000000..def5540
--- /dev/null
@@ -0,0 +1,41 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 448 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5 security=none"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/repo-protected/tizen/releases/2.2/latest/repos/tizen-base/ia32/packages/ --ssl_verify=no --user=testspec --passwd=pass@,:%
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/repo-protected/tizen/releases/2.2/latest/repos/tizen-main/ia32/packages/ --save  --ssl_verify=no --user=testspec --passwd=pass@,:%
+
+%packages
+coreutils
+bash
+kernel*
+rpm
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+
+%post
+# Set environment for launchpad daemon. Fix TDIST-264
+cat > /etc/sysconfig/launchpad <<EOF
+DISPLAY=:0
+EOF
+%end
+
+%post --nochroot
+
+%end
diff --git a/fixtures/ks_files/ivi-2.0-alpha-debuginfo.ks b/fixtures/ks_files/ivi-2.0-alpha-debuginfo.ks
new file mode 100644 (file)
index 0000000..63af1f2
--- /dev/null
@@ -0,0 +1,38 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot
+part / --size 1600 --ondisk sdb --fstype=ext4 --label platform
+
+rootpw tizen 
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"   
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base  --baseurl=http://download.tizen.org/snapshots/tizen/ivi/latest/repos/atom/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=base-debug --baseurl=http://download.tizen.org/snapshots/tizen/ivi/latest/repos/atom/debug/  --save --source --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+rpm
+bash
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi-mbr-i586-with-proxy.ks b/fixtures/ks_files/ivi-mbr-i586-with-proxy.ks
new file mode 100644 (file)
index 0000000..efa8034
--- /dev/null
@@ -0,0 +1,112 @@
+# -*-mic2-options-*- -f raw --fstab=uuid --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part /boot --size 64 --ondisk sdb --fstype=ext4 --label boot --active --align 1024 --fsoptions=noatime
+part / --size 3748 --ondisk sdb --fstype=ext4 --label platform --align 1024 --fsoptions=noatime
+
+rootpw tizen 
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"   --ptable=gpt
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video,weston-launch --password 'tizen'
+
+installerfw_plugins "bootloader,fstab"
+
+repo --name=ivi --baseurl=http://download.tizen.org/snapshots/tizen/ivi/latest/repos/atom/packages/  --proxy=http://proxy-mu.intel.com:911
+
+%packages
+
+coreutils
+bash
+tzdata
+kernel*
+
+%end
+
+
+
+%post
+# base-general.post
+
+ln -sf /proc/self/mounts /etc/mtab
+
+rm -rf /root/.zypp
+
+
+#Hack to temporarily disable net-config, which collides with settingsd. Related to TIVI-2569
+
+rm /usr/lib/systemd/system/multi-user.target.wants/net-config.service 
+
+# rpm.post
+rm -f /var/lib/rpm/__db*
+rpmdb --rebuilddb
+
+# Initialize the native application database
+pkg_initdb
+
+# Add 'app' user to the weston-launch group
+/usr/sbin/groupmod -A app weston-launch
+
+# Temporary work around for bug in filesystem package resulting in the 'app' user home
+# directory being only readable by root
+chown -R app:app /opt/home/app
+
+# Since weston-launch runs with the "User" label, the app
+# home dir must have the same label
+chsmack -a User /opt/home/app
+
+# Enable a logind session for 'app' user on seat0 (the default seat for
+# graphical sessions)
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+ln -s ../user-session-launch@.service /usr/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service
+ln -sf weston.target  /usr/lib/systemd/user/default.target
+
+# Add over-riding environment to enable the web runtime to
+# run on an IVI image as a different user then the tizen user
+# Some notes on some of the variables:
+#  - ELM_THEME is needed in order for the wrt to have visible content
+#  - WRT_PROCESS_POOL_DISABLE is a work around for TIVI-2062
+cat > /etc/sysconfig/wrt <<EOF
+DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket
+XDG_RUNTIME_DIR=/run/user/5000
+ELM_ENGINE=wayland_egl
+ECORE_EVAS_ENGINE=wayland_egl
+ELM_THEME=tizen-HD-light
+WRT_PROCESS_POOL_DISABLE=1
+EOF
+
+# Use the same over-rides for the native prelaunch daemon
+cp /etc/sysconfig/wrt /etc/sysconfig/launchpad
+
+# Add a rule to ensure the app user has permissions to
+# open the graphics device
+cat > /etc/udev/rules.d/99-dri.rules <<EOF
+SUBSYSTEM=="drm", MODE="0666"
+EOF
+
+# Needed to fix TIVI-1629
+vconftool set -t int -f db/setting/default_memory/wap 0
+
+# Install and configure the boot-loader, /etc/fstab, and so on
+/usr/sbin/setup-ivi-boot
+
+
+%end
+
+%post --nochroot
+# buildname.nochroot 
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+
+
+%end
diff --git a/fixtures/ks_files/ivi-mbr-i586.ks b/fixtures/ks_files/ivi-mbr-i586.ks
new file mode 100644 (file)
index 0000000..31dfadd
--- /dev/null
@@ -0,0 +1,112 @@
+# -*-mic2-options-*- -f raw --fstab=uuid --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part /boot --size 64 --ondisk sdb --fstype=ext4 --label boot --active --align 1024 --fsoptions=noatime
+part / --size 3748 --ondisk sdb --fstype=ext4 --label platform --align 1024 --fsoptions=noatime
+
+rootpw tizen 
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"   --ptable=gpt
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video,weston-launch --password 'tizen'
+
+installerfw_plugins "bootloader,fstab"
+
+repo --name=ivi --baseurl=http://download.tizen.org/snapshots/tizen/ivi/latest/repos/atom/packages/
+
+%packages
+
+coreutils
+bash
+tzdata
+kernel*
+
+%end
+
+
+
+%post
+# base-general.post
+
+ln -sf /proc/self/mounts /etc/mtab
+
+rm -rf /root/.zypp
+
+
+#Hack to temporarily disable net-config, which collides with settingsd. Related to TIVI-2569
+
+rm /usr/lib/systemd/system/multi-user.target.wants/net-config.service 
+
+# rpm.post
+rm -f /var/lib/rpm/__db*
+rpmdb --rebuilddb
+
+# Initialize the native application database
+pkg_initdb
+
+# Add 'app' user to the weston-launch group
+/usr/sbin/groupmod -A app weston-launch
+
+# Temporary work around for bug in filesystem package resulting in the 'app' user home
+# directory being only readable by root
+chown -R app:app /opt/home/app
+
+# Since weston-launch runs with the "User" label, the app
+# home dir must have the same label
+chsmack -a User /opt/home/app
+
+# Enable a logind session for 'app' user on seat0 (the default seat for
+# graphical sessions)
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+ln -s ../user-session-launch@.service /usr/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service
+ln -sf weston.target  /usr/lib/systemd/user/default.target
+
+# Add over-riding environment to enable the web runtime to
+# run on an IVI image as a different user then the tizen user
+# Some notes on some of the variables:
+#  - ELM_THEME is needed in order for the wrt to have visible content
+#  - WRT_PROCESS_POOL_DISABLE is a work around for TIVI-2062
+cat > /etc/sysconfig/wrt <<EOF
+DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket
+XDG_RUNTIME_DIR=/run/user/5000
+ELM_ENGINE=wayland_egl
+ECORE_EVAS_ENGINE=wayland_egl
+ELM_THEME=tizen-HD-light
+WRT_PROCESS_POOL_DISABLE=1
+EOF
+
+# Use the same over-rides for the native prelaunch daemon
+cp /etc/sysconfig/wrt /etc/sysconfig/launchpad
+
+# Add a rule to ensure the app user has permissions to
+# open the graphics device
+cat > /etc/udev/rules.d/99-dri.rules <<EOF
+SUBSYSTEM=="drm", MODE="0666"
+EOF
+
+# Needed to fix TIVI-1629
+vconftool set -t int -f db/setting/default_memory/wap 0
+
+# Install and configure the boot-loader, /etc/fstab, and so on
+/usr/sbin/setup-ivi-boot
+
+
+%end
+
+%post --nochroot
+# buildname.nochroot 
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+
+
+%end
diff --git a/fixtures/ks_files/ivi.ks b/fixtures/ks_files/ivi.ks
new file mode 100644 (file)
index 0000000..d36a7d9
--- /dev/null
@@ -0,0 +1,39 @@
+# -*-mic2-options-*- -f raw --fstab=uuid --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot
+part / --size 968 --ondisk sdb --fstype=ext4 --label platform
+
+rootpw tizen 
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"   
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+tzdata
+kernel*
+rpm
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi_624.ks b/fixtures/ks_files/ivi_624.ks
new file mode 100644 (file)
index 0000000..c779288
--- /dev/null
@@ -0,0 +1,38 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot --align=1024
+part / --size 768 --ondisk sdb --fstype=ext4 --label platform
+
+rootpw tizen 
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"   
+
+desktop --autologinuser=tizen  
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/  --save --gpgkey=0 --ssl_verify=no
+
+%packages --ignoremissing
+coreutils
+bash
+tzdata
+kernel*
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi_broken_content_bootstrap.ks b/fixtures/ks_files/ivi_broken_content_bootstrap.ks
new file mode 100644 (file)
index 0000000..77be117
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-mic2-options-*- -f raw --fstab=uuid --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot --active --align 1024
+part / --size 768 --ondisk sdb --fstype=ext4 --label platform --align 1024
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-ivi-new --baseurl=http://linux-ftp.fi.intel.com/repo-ivi-broken-content-bootstrap/ia32/packages/  --ssl_verify=no --gpgkey=0
+
+%packages --ignoremissing
+coreutils
+bash
+tzdata
+kernel*
+%end
diff --git a/fixtures/ks_files/ivi_four_partition_gpt.ks b/fixtures/ks_files/ivi_four_partition_gpt.ks
new file mode 100644 (file)
index 0000000..42988eb
--- /dev/null
@@ -0,0 +1,40 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part /test1 --size 64 --ondisk sdb --fstype=ext4 --label test1 --align 1024
+part /test2 --size 64 --ondisk sdb --fstype=ext4 --label test2 --align 1024
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot --align 1024
+part / --size 768 --ondisk sdb --fstype=ext4 --label platform --align 1024
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"  --ptable=gpt
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages --ignoremissing
+coreutils
+bash
+tzdata
+kernel*
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi_four_partition_mbr.ks b/fixtures/ks_files/ivi_four_partition_mbr.ks
new file mode 100644 (file)
index 0000000..dce851a
--- /dev/null
@@ -0,0 +1,40 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part /test1 --size 64 --ondisk sdb --fstype=ext4 --label test1 --align 1024
+part /test2 --size 64 --ondisk sdb --fstype=ext4 --label test2 --align 1024
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot --align 1024
+part / --size 768 --ondisk sdb --fstype=ext4 --label platform --align 1024
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages --ignoremissing
+coreutils
+bash
+tzdata
+kernel*
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi_gpt_with_part-type.ks b/fixtures/ks_files/ivi_gpt_with_part-type.ks
new file mode 100644 (file)
index 0000000..6b73916
--- /dev/null
@@ -0,0 +1,41 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+#
+# Do not Edit! Generated by:
+# kickstarter.py
+#
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part /boot --size 64 --ondisk sdb --fstype=ext4 --label boot --active --align 1024
+part / --size 672 --ondisk sdb --fstype=ext4 --label platform --align 1024 --part-type=0FC63DAF-8483-4772-8E79-3D69D8477DE4
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4"   --ptable=gpt
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video,weston-launch --password 'tizen'
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+tzdata
+kernel*
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi_invalid_content_mic-bootstrap.ks b/fixtures/ks_files/ivi_invalid_content_mic-bootstrap.ks
new file mode 100644 (file)
index 0000000..c22c36b
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-mic2-options-*- -f raw --fstab=uuid --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot --active --align 1024
+part / --size 768 --ondisk sdb --fstype=ext4 --label platform --align 1024
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-ivi-new --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/ivi/tizen-2.0_20130311.2/repos/ivi-bootstrap-problem-bootstrap/ia32/packages/  --ssl_verify=no --gpgkey=0
+
+%packages --ignoremissing
+coreutils
+bash
+tzdata
+kernel*
+%end
diff --git a/fixtures/ks_files/ivi_no_mountpoint.ks b/fixtures/ks_files/ivi_no_mountpoint.ks
new file mode 100644 (file)
index 0000000..4fe5f6d
--- /dev/null
@@ -0,0 +1,39 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part  --size 32 --ondisk sdb --fstype=ext4 --label boot
+part  --size 768 --ondisk sdb --fstype=ext4 --label platform
+
+rootpw tizen 
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+tzdata
+kernel*
+rpm
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi_no_partition.ks b/fixtures/ks_files/ivi_no_partition.ks
new file mode 100644 (file)
index 0000000..326b415
--- /dev/null
@@ -0,0 +1,37 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+tzdata
+kernel*
+rpm
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi_packages.ks b/fixtures/ks_files/ivi_packages.ks
new file mode 100644 (file)
index 0000000..f7acfb9
--- /dev/null
@@ -0,0 +1,45 @@
+# -*-mic2-options-*- -f raw --fstab=uuid --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot
+part / --size 968 --ondisk sdb --fstype=ext4 --label platform
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+#@Base System
+@generic-base-micro
+kernel*
+#-util-linux
+-bluez
+bash.i686
+python-setuptools
+*desktop*
+*mozilla
+grep
+rpm
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi_syslinux_problem.ks b/fixtures/ks_files/ivi_syslinux_problem.ks
new file mode 100644 (file)
index 0000000..f47d5bb
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot
+part / --size 768 --ondisk sdb --fstype=ext4 --label platform
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-ivi --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/ivi/syslinux_problem_rep/repos/tizen/ia32/packages/ --ssl_verify=no --gpgkey=0
+
+%packages --ignoremissing
+coreutils
+bash
+tzdata
+kernel*
+%end
diff --git a/fixtures/ks_files/ivi_with_active_partition.ks b/fixtures/ks_files/ivi_with_active_partition.ks
new file mode 100644 (file)
index 0000000..39721f1
--- /dev/null
@@ -0,0 +1,39 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part / --size 768 --ondisk sdb --fstype=ext4 --label platform
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot --active
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 quiet"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+tzdata
+kernel*
+rpm
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/ivi_with_active_partition_gpt.ks b/fixtures/ks_files/ivi_with_active_partition_gpt.ks
new file mode 100644 (file)
index 0000000..7f6c27c
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-mic2-options-*- -f raw --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+#Partitions: size unit is MB
+part / --size 768 --ondisk sdb --fstype=ext4 --label platform
+part /boot --size 32 --ondisk sdb --fstype=ext4 --label boot --active
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --ptable=gpt --append="rootwait rootfstype=ext4 quiet"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages --ignoremissing
+coreutils
+bash
+tzdata
+kernel*
+%end
diff --git a/fixtures/ks_files/ivi_with_installerfw.ks b/fixtures/ks_files/ivi_with_installerfw.ks
new file mode 100644 (file)
index 0000000..903ed7c
--- /dev/null
@@ -0,0 +1,44 @@
+# -*-mic2-options-*- -f raw --fstab=name --copy-kernel --compress-disk-image=bz2 --generate-bmap -*-mic2-options-*-
+
+#
+# Do not Edit! Generated by:
+# kickstarter.py
+#
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part /boot --size 64 --ondisk sdb --fstype=ext3 --label boot --active --align 1024 --part-type C12A7328-F81F-11D2-BA4B-00A0C93EC93B
+part / --size 748 --ondisk sdb --fstype=ext4 --label platform --align 1024
+
+rootpw tizen
+xconfig --startxonboot
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4"   --ptable=gpt
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video,weston-launch --password 'tizen'
+
+installerfw_plugins "bootloader"
+
+repo --name=base  --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/ivi/latest/repos/atom/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+coreutils
+bash
+tzdata
+kernel*
+rpm
+%end
+
+%post
+rm -rf /root/.zypp
+mkdir -p /usr/lib/systemd/system/graphical.target.wants
+%end
+
+%post --nochroot
+# buildname.nochroot
+if [ -n "$IMG_NAME" ]; then
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+    echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+fi
+%end
diff --git a/fixtures/ks_files/obsolete_test_one.ks b/fixtures/ks_files/obsolete_test_one.ks
new file mode 100644 (file)
index 0000000..c018639
--- /dev/null
@@ -0,0 +1,21 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 848 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5 security=none"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=base2 --baseurl=file:///home/build/tmp_repo2/
+%packages
+A
+AAA
+%end
+
diff --git a/fixtures/ks_files/obsolete_test_two.ks b/fixtures/ks_files/obsolete_test_two.ks
new file mode 100644 (file)
index 0000000..8bfee15
--- /dev/null
@@ -0,0 +1,21 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 848 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5 security=none"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=base2 --baseurl=file:///home/build/tmp_repo1/
+%packages
+A
+AA
+%end
+
diff --git a/fixtures/ks_files/qcow_image.ks b/fixtures/ks_files/qcow_image.ks
new file mode 100644 (file)
index 0000000..6b7fb49
--- /dev/null
@@ -0,0 +1,417 @@
+# -*-mic2-options-*- -f qcow  --copy-kernel -*-mic2-options-*-
+
+# 
+# Do not Edit! Generated by:
+# kickstarter.py
+# 
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+part / --fstype="ext4" --size=3584 --ondisk=sda --active --label emulimg-3.0 --fsoptions=defaults,noatime
+
+rootpw tizen 
+xconfig --startxonboot
+bootloader  --timeout=3  --append="rw vga=current splash rootwait rootfstype=ext4 plymouth.enable=0"   --ptable=gpt --menus="install:Wipe and Install:systemd.unit=system-installer.service:test"
+
+desktop --autologinuser=guest
+user --name guest  --groups audio,video --password 'tizen'
+
+
+repo --name=common-emulator-wayland_i586 --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/daily/tizen/common/latest/repos/emulator32-wayland/packages/ --ssl_verify=no
+
+%packages
+
+@Generic Base
+@Common Base
+@Generic Console Tools
+@Generic Packaging
+@Common Packaging
+@Generic Adaptation
+@Generic Wayland
+@Common Wayland
+@Generic Middleware
+@Common Middleware
+@Generic Applications
+@Generic Bluetooth
+@Generic Multimedia
+@Generic Desktop Applications
+@Common Desktop Applications
+@Generic Crosswalk
+@Common Crosswalk
+@Generic Qt5
+@Common Qt5
+@Generic Multimedia Intel
+
+kernel-profile-common
+
+sdbd
+system-plugin-emulator
+%end
+
+
+
+%post
+#!/bin/sh
+echo "#################### generic-base.post ####################"
+
+# setup systemd default target for user session
+cat <<'EOF' >>/lib/systemd/user/default.target
+[Unit]
+Description=User session default target
+EOF
+mkdir -p /lib/systemd/user/default.target.wants
+
+# start dbus session
+ln -s ../dbus.service /lib/systemd/user/default.target.wants/
+
+# Run prelink to speed up dynamic binary/library loading
+/usr/sbin/prelink --all
+
+ln -sf /proc/self/mounts /etc/mtab
+
+# sdx: fix smack labels on /var/log
+chsmack -a '*' /var/log
+
+# workaround for bug PTREL-763
+patch -b -p1 -d/ <<'EOF'
+--- bad/etc/pam.d/systemd-user 2014-03-20 10:01:36.657843073 +0100
++++ good/etc/pam.d/systemd-user 2014-03-20 10:06:51.586121696 +0100
+@@ -4,5 +4,6 @@
+ account include system-auth
+ session include system-auth
++session required pam_systemd.so
+ auth required pam_deny.so
+ password required pam_deny.so
+EOF
+
+# create appfw dirs inside homes
+function generic_base_user_exists() {
+       user=$1
+       getent passwd | grep -q ^${user}:
+}
+
+function generic_base_user_home() {
+       user=$1
+       getent passwd | grep ^${user}: | cut -f6 -d':'
+}
+
+function generic_base_fix_user_homedir() {
+       user=$1
+       generic_base_user_exists $user || return 1
+
+       homedir=$(generic_base_user_home $user)
+       mkdir -p $homedir/app_rw
+       for appdir in desktop manifest dbspace; do
+               mkdir -p $homedir/.applications/$appdir
+       done
+       find $homedir -type d -exec chsmack -a User {} \;
+       chown -R $user:users $homedir
+       return 0
+}
+
+#!/bin/sh
+echo "############### common-base.post ################"
+
+######### multiuser mode: create additional users and fix their homedirs
+tizen_crypted_pass=$(perl -e 'print crypt("tizen", "aa")')
+uid=5001
+
+for user in alice bob carol guest; do
+       if ! generic_base_user_exists $user; then
+               useradd -u $uid -d /home/$user -g users -G audio,video,users,display -m --password "$tizen_crypted_pass" $user
+               uid=$(( $uid + 1 ))
+       fi
+
+       generic_base_fix_user_homedir $user
+done
+
+
+
+
+#!/bin/sh
+echo "#################### generic-console-tools.post ####################"
+
+# customize bash prompt
+cat >/etc/profile.d/bash_prompt_custom.sh <<'EOF'
+if [ "$PS1" ]; then
+
+       function proml {
+               # set a fancy prompt (overwrite the one in /etc/profile)
+               local default="\[\e[0m\]"
+               local usercol='\[\e[1;34m\]' # blue
+               local hostcol='\[\e[1;32m\]' # green
+               local pathcol='\[\e[1;33m\]' # yellow
+               local gitcol='\[\e[1;31m\]' # light red
+               local termcmd=''
+               local _p="$";
+
+               if [ "`id -u`" -eq 0 ]; then
+                       usercol='\[\e[1;31m\]'
+                       _p="#"
+               fi
+
+               PS1="${usercol}\u${default}@${hostcol}\h${default}:${pathcol}\w${default}${gitcol}${default}${_p} ${termcmd}"
+       }
+
+       proml
+
+       function rcd () {
+      [ "${1:0:1}" == "/" ] && { cd $1; } || { cd $(pwd -P)/$1; }
+   }
+
+       alias ll="ls -lZ"
+       alias lr="ls -ltrZ"
+       alias la="ls -alZ"
+
+       function get_manifest () {
+               rpm -qa --queryformat="%{name} %{Version} %{Release} %{VCS}\n" | sort
+       }
+fi
+EOF
+
+
+#!/bin/sh
+echo "#################### generic-packaging.post ####################"
+
+rm -rf /root/.zypp
+
+# was: rpm.post
+rm -f /var/lib/rpm/__db*
+rpmdb --rebuilddb
+
+
+#!/bin/sh
+echo "############### common-packaging.post ################"
+
+# generate repo files for zypper
+function genrepo() {
+       local url=$1
+       local reponame=$2
+       local filename=${3:-$2}
+       local enabled=${4:-0}
+
+       local prefix=${TZ_BUILD_VENDOR}-${TZ_BUILD_PROFILE}-${TZ_BUILD_REPO}
+
+       # remove double slashes if any
+       url=$(sed -e  's|/\+|/|g' -e 's|:/|://|' <<<$url)
+
+       cat >> /etc/zypp/repos.d/$prefix-${filename}.repo << EOF
+[$prefix-${reponame}]
+name=$prefix-${reponame}
+enabled=$enabled
+autorefresh=0
+baseurl=${url}?ssl_verify=no
+type=rpm-md
+gpgcheck=0
+EOF
+}
+
+# source /etc/tizen-build.conf to get more infos about project, repos etc.
+. /etc/tizen-build.conf 
+
+# adjust build_id if this scripts executes before the replacement in /etc/tizen-build.conf
+TZ_BUILD_ID=$(echo $TZ_BUILD_ID | sed 's|@BUILD_ID[@]|tizen-common_20141118.1|')
+
+# snapshot repo
+genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/packages snapshot snapshot 1
+genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/debug snapshot-debug snapshot 1
+
+# latest repo
+genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/packages update update 0
+genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/debug update-debug update 0
+
+# daily repo
+genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/packages daily daily 0
+genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/debug daily-debug daily 0
+
+# weekly repo
+genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/packages weekly weekly 0
+genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/debug weekly-debug weekly 0
+
+
+#!/bin/sh
+echo "#################### generic-adaptation.post ####################"
+
+# fix TIVI-2291
+sed -ri "s/(^blacklist i8042.*$)/#fix from base-general.post \1/" /etc/modprobe.d/blacklist.conf
+
+
+#!/bin/sh
+echo "#################### generic-wayland.post ####################"
+
+
+#!/bin/sh
+echo "#################### common-wayland.post ##################"
+
+# add users to display group
+for user in alice bob carol guest; do
+       if generic_base_user_exists $user; then
+               /usr/sbin/groupmod -A $user display
+       fi
+done
+
+# Enable a logind session for users on seat0 (the default seat for
+# graphical sessions)
+unitdir=/usr/lib/systemd/system
+mkdir -p $unitdir/graphical.target.wants
+for user in alice bob carol guest; do
+       generic_base_user_exists $user || continue
+       uid=$(getent passwd $user|cut -f3 -d':')
+       ln -s ../user-session-launch@.service $unitdir/graphical.target.wants/user-session-launch@seat0-$uid.service
+done
+
+# user sessions must start after graphical target
+patch -b -p1 -d/ <<'EOF'
+--- /lib/systemd/system/user-session-launch@.service.orig      2014-03-17 17:50:18.000000000 -0700
++++ /lib/systemd/system/user-session-launch@.service   2014-04-15 06:03:45.555682575 -0700
+@@ -1,7 +1,7 @@
+ [Unit]
+ Description=User Session Launcher
+-After=systemd-user-sessions.service systemd-logind.service
+-Requires=systemd-logind.service
++After=systemd-user-sessions.service systemd-logind.service display-manager.path
++Requires=systemd-logind.service display-manager.path
+ [Service]
+ ExecStart=/usr/bin/user-session-launch %i
+EOF
+
+# clean weston target inside user session (installed by weston)
+rm -f /usr/lib/systemd/user/weston.target
+
+
+#{ Add installed apps for tizen to launcher if not present
+dst="/usr/share/applications/tizen/launcher.conf"
+
+if [ -w "$dst" ] ; then
+   ls /usr/share/applications/tizen/*.desktop \
+   | while read src; do
+        grep "$src" "$dst" \
+            || { [ ! -r "$src" ] || echo "$src" >> "$dst" ; }
+
+    done
+fi
+
+#}
+
+# tag the background image with the current snapshot id
+arch=$(rpm -qa | grep kernel-common | awk -F- '{printf("%s %s",$3,$4);}')
+/usr/bin/mark_image.py /usr/share/backgrounds/tizen/current "Tizen Common: tizen-common_20141118.1 $arch" ffffff 50 90 95 95
+
+
+#!/bin/sh
+echo "#################### generic-middleware.post ####################"
+
+
+#!/bin/sh
+echo "############### common-middleware.post ################"
+
+
+#!/bin/sh
+echo "#################### generic-applications.post ####################"
+
+
+#!/bin/sh
+echo "#################### generic-bluetooth.post ####################"
+
+
+#!/bin/sh
+echo "#################### generic-multimedia.post ####################"
+
+
+#!/bin/sh
+echo "#################### generic-desktop-applications.post ####################"
+
+# temp workaround to fill each user app_info database with global db infos
+. /etc/tizen-platform.conf
+ail_initdb
+pkg_initdb
+
+# depends on generic-base functions
+function generic_desktop_applications_fix_userhome() {
+       user=$1
+
+       generic_base_user_exists $user || return 1
+       homedir=$(generic_base_user_home $user)
+       
+       echo "Fix app_info.db of $user"
+       chown -R $user:users $homedir/.applications/dbspace/
+}
+
+
+
+#!/bin/sh
+echo "############### common-desktop-applications.post ################"
+
+# call function defined in meta-generic
+for user in alice bob carol guest; do
+       generic_desktop_applications_fix_userhome $user
+done
+
+
+
+#!/bin/sh
+echo "#################### generic-crosswalk.post ####################"
+
+# make crosswak start in user session (default target)
+mkdir -p /lib/systemd/user/default.target.wants/
+ln -s ../xwalk.service /lib/systemd/user/default.target.wants/
+
+
+
+#!/bin/sh
+echo "############### common-crosswalk.post ################"
+
+# start wrt widgets preinstall
+prepare_widgets.sh
+
+
+#!/bin/sh
+echo "#################### generic-qt5.post ####################"
+
+
+#!/bin/sh
+echo "############### common-qt5.post ################"
+
+list='
+qt5-qtdeclarative-examples
+qt5-cinematic-experience
+'
+
+dst="/usr/share/applications/tizen/launcher.conf"
+
+if [ -w "$dst" ] ; then
+    for app in $list ; do
+        src="/usr/share/applications/$app.desktop"
+
+        grep "$src" "$dst" \
+            || { [ ! -r "$src" ] || echo "$src" >> "$dst" ; }
+
+    done
+fi
+
+#!/bin/sh
+echo "#################### generic-multimedia-intel.post ####################"
+
+
+
+%end
+
+%post --nochroot
+####################### buildname.nochroot #######################
+if [ -n "$IMG_NAME" ]; then
+       echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/tizen-release
+       echo "BUILD_ID=$IMG_NAME" >> $INSTALL_ROOT/etc/os-release
+       echo "$IMG_NAME tizen-common_20141118.1" >>$INSTALL_ROOT/etc/tizen-snapshot
+
+       sed -ri \
+               -e 's|@BUILD_ID[@]|tizen-common_20141118.1|g' \
+               -e "s|@BUILD_DATE[@]|$(date +%Y%m%d_%H%M%S)|g" \
+               $INSTALL_ROOT/etc/tizen-build.conf
+fi
+
+
+%end
diff --git a/fixtures/ks_files/strict_mode.ks b/fixtures/ks_files/strict_mode.ks
new file mode 100644 (file)
index 0000000..c139313
--- /dev/null
@@ -0,0 +1,21 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+
+part / --size 848 --ondisk sda --fstype=ext3 --label platform
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5 security=none"
+
+desktop --autologinuser=tizen
+user --name tizen  --groups audio,video --password 'tizen'
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-base/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/repo/download.tizen.org/releases/2.2/tizen-2.2_20130719.3/repos/tizen-main/ia32/packages/  --save --gpgkey=0 --ssl_verify=no
+repo --name=myrepo --baseurl=file:///home/build/strict_mode
+
+%packages
+hello
+%end
diff --git a/fixtures/ks_files/whole_rd_210.ks b/fixtures/ks_files/whole_rd_210.ks
new file mode 100644 (file)
index 0000000..6ddd444
--- /dev/null
@@ -0,0 +1,64 @@
+# -*-mic2-options-*- -f loop --pack-to=@NAME@.tar.gz -*-mic2-options-*-
+#
+# Do not Edit! Generated by:
+# kickstarter.py
+#
+
+lang en_US.UTF-8
+keyboard us
+timezone --utc America/Los_Angeles
+# ROOT fs partition
+part / --size=800 --ondisk mmcblk0p --fstype=ext4 --label=platform
+# DATA partition
+part /opt/ --size=200 --ondisk mmcblk0p --fstype=ext4 --label=data
+# UMS partition
+part /opt/usr/ --size=300 --ondisk mmcblk0p --fstype=ext4 --label=ums
+
+rootpw tizen
+bootloader  --timeout=0  --append="rootdelay=5"
+
+desktop --autologinuser=root
+user --name root  --groups audio,video --password ''
+
+repo --name=Tizen-base --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.0/latest/repos/base/ia32/packages/ --save --gpgkey=0 --ssl_verify=no
+repo --name=Tizen-main --baseurl=http://linux-ftp.fi.intel.com/pub/mirrors/tizen/releases/2.0/latest/repos/main/ia32/packages/ --save --gpgkey=0 --ssl_verify=no
+
+%packages
+shadow-utils
+coreutils
+bash
+kernel*
+%end
+
+%prepackages
+eglibc
+libgcc
+libudev
+libattr
+%end
+
+%attachment
+preos-runtime
+bootstub-bb
+/boot/cmdline
+/boot/vmlinuz-*
+%end
+%post
+echo 'kickstart post script start'
+if [ -d /etc/init.d ]; then
+    cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
+fi
+rm -rf /etc/init.d*
+ln -sf /etc/rc.d/init.d /etc/init.d
+%end
+
+%post --nochroot
+if [ -f /etc/device-sec-policy ]; then
+    cp -fp /etc/device-sec-policy $INSTALL_ROOT/etc/
+fi
+
+if [ -d /etc/smack/accesses.d ]; then
+    mkdir -p $INSTALL_ROOT/opt/etc/smack/accesses.d
+    cp -rfp /etc/smack/accesses.d/* $INSTALL_ROOT/opt/etc/smack/accesses.d/
+fi
+%end
diff --git a/fixtures/py_scripts/test_logging.py b/fixtures/py_scripts/test_logging.py
new file mode 100644 (file)
index 0000000..0c7332c
--- /dev/null
@@ -0,0 +1,11 @@
+import logging
+from mic import msger
+import os
+
+logging.basicConfig()
+main = logging.getLogger('mic')
+first_output = main.info('hello')
+raw = logging.getLogger('mic.raw')
+two_level_output = raw.info('raw')
+imager = logging.getLogger('mic.raw.imager')
+three_level_output = raw.info('imager')
diff --git a/fixtures/rpm/A-2.0-1.x86_64.rpm b/fixtures/rpm/A-2.0-1.x86_64.rpm
new file mode 100644 (file)
index 0000000..3e87465
Binary files /dev/null and b/fixtures/rpm/A-2.0-1.x86_64.rpm differ
diff --git a/fixtures/rpm/AA-1.0-1.x86_64.rpm b/fixtures/rpm/AA-1.0-1.x86_64.rpm
new file mode 100644 (file)
index 0000000..7716583
Binary files /dev/null and b/fixtures/rpm/AA-1.0-1.x86_64.rpm differ
diff --git a/fixtures/rpm/AAA-1.0-1.x86_64.rpm b/fixtures/rpm/AAA-1.0-1.x86_64.rpm
new file mode 100644 (file)
index 0000000..69a07de
Binary files /dev/null and b/fixtures/rpm/AAA-1.0-1.x86_64.rpm differ
diff --git a/fixtures/rpm/pri_rpm/fake-1.0-1.i586.rpm b/fixtures/rpm/pri_rpm/fake-1.0-1.i586.rpm
new file mode 100644 (file)
index 0000000..e75aea3
Binary files /dev/null and b/fixtures/rpm/pri_rpm/fake-1.0-1.i586.rpm differ
diff --git a/fixtures/rpm/pri_rpm/fake-2.0-1.i586.rpm b/fixtures/rpm/pri_rpm/fake-2.0-1.i586.rpm
new file mode 100644 (file)
index 0000000..b0f3fb4
Binary files /dev/null and b/fixtures/rpm/pri_rpm/fake-2.0-1.i586.rpm differ
diff --git a/fixtures/rpm/sed-4.1.5-2.2.armv7l.rpm b/fixtures/rpm/sed-4.1.5-2.2.armv7l.rpm
new file mode 100644 (file)
index 0000000..a0c9cd2
Binary files /dev/null and b/fixtures/rpm/sed-4.1.5-2.2.armv7l.rpm differ
diff --git a/fixtures/rpm/sed-4.2.1-1.3.i686.rpm b/fixtures/rpm/sed-4.2.1-1.3.i686.rpm
new file mode 100644 (file)
index 0000000..888eca2
Binary files /dev/null and b/fixtures/rpm/sed-4.2.1-1.3.i686.rpm differ
diff --git a/fixtures/rpm/strict_mode_rpm/hello-1.0-1.x86_64.rpm b/fixtures/rpm/strict_mode_rpm/hello-1.0-1.x86_64.rpm
new file mode 100644 (file)
index 0000000..22acece
Binary files /dev/null and b/fixtures/rpm/strict_mode_rpm/hello-1.0-1.x86_64.rpm differ
diff --git a/fixtures/scripts/compute_space.sh b/fixtures/scripts/compute_space.sh
new file mode 100644 (file)
index 0000000..bdc2349
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+compute_space(){
+left_space=`df -h | grep '/$' | awk '{print $4}'`
+if echo $left_space | grep -q 'G'
+ then
+      space_number=`echo $left_space | awk -F 'G' '{print $1}'`
+      int_value=`awk "BEGIN{print int($space_number)}"`
+      if [ $int_value -lt 2 ] 
+      then
+          echo 'space not enough'
+      fi
+else
+    echo 'space not enough'
+fi
+echo 'continue run'
+}
+compute_space
\ No newline at end of file
diff --git a/fixtures/scripts/compute_volume.sh b/fixtures/scripts/compute_volume.sh
new file mode 100644 (file)
index 0000000..90e943f
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+compute_volume(){
+
+ volume=`du $1 -sh  | awk '{print $1}'`
+ if echo $volume | grep -q 'G'
+ then
+      original_value=`echo $volume | awk -F 'G' '{print $1}'`
+      m_value=`echo $original_value \* 1000 | bc`
+      m_value=`awk "BEGIN{print int($m_value)}"`
+ elif echo $volume | grep -q 'M'
+ then
+      m_value=`echo $volume | awk -F 'M' '{print $1}'`
+ fi
+ echo $m_value
+}
+
+#result=`compute_volume /home/lhh/testspace/running/b6e402d31bcd42f8bbb94929c1d83fea/out1/platform.img`
+#echo $result
\ No newline at end of file
diff --git a/packaging/.gitignore b/packaging/.gitignore
new file mode 100644 (file)
index 0000000..8f8a7ab
--- /dev/null
@@ -0,0 +1,2 @@
+.osc/
+itest-cases-mic*.tar.gz
diff --git a/packaging/Makefile b/packaging/Makefile
new file mode 100644 (file)
index 0000000..4d69ab4
--- /dev/null
@@ -0,0 +1,19 @@
+PKG_NAME := itest-cases-mic
+SPECFILE = $(addsuffix .spec, $(PKG_NAME))
+PKG_VERSION := $(shell grep '^Version: ' $(SPECFILE)|awk '{print $$2}')
+
+TARBALL := $(PKG_NAME)_$(PKG_VERSION).tar.gz
+
+dsc: tarball
+       $(eval MD5=$(shell md5sum $(TARBALL) | sed "s/  / $(shell stat -c '%s' $(TARBALL)) /"))
+       sed  -i 's/^Version:.*/Version: $(PKG_VERSION)/' $(PKG_NAME).dsc
+       sed  -i 's/ [a-f0-9]\+ [0-9]\+ $(PKG_NAME).*tar.*/ $(MD5)/' $(PKG_NAME).dsc
+
+tarball:
+       cd .. && git archive --prefix $(PKG_NAME)-$(PKG_VERSION)/ HEAD \
+                               | gzip > packaging/$(TARBALL)
+
+clean:
+       rm -f $(PKG_NAME)*tar*
+
+all: tarball dsc
diff --git a/packaging/itest-cases-mic.changes b/packaging/itest-cases-mic.changes
new file mode 100644 (file)
index 0000000..0a6f8b4
--- /dev/null
@@ -0,0 +1,5 @@
+* Wed Sep 26 2013 Huang Hao <hao.h.huang@intel.com> a7c12c5
+- Add packaging files
+- Adding changelog cases and corresponding fixtures
+- Initial commit
+
diff --git a/packaging/itest-cases-mic.dsc b/packaging/itest-cases-mic.dsc
new file mode 100644 (file)
index 0000000..f534176
--- /dev/null
@@ -0,0 +1,10 @@
+Format: 1.0
+Source: itest-cases-mic
+Version: 0.1
+Binary: itest-cases-mic
+Maintainer: Huanhuan Li <huanhuanx.li@intel.com>
+Architecture: all
+Standards-Version: 1.0
+Build-Depends: debhelper (>= 4.0.0)
+Files:
+ 29502675ffc3d433d10df2a99a4bf4fc 13019 itest-cases-mic_0.1.tar.gz
diff --git a/packaging/itest-cases-mic.spec b/packaging/itest-cases-mic.spec
new file mode 100644 (file)
index 0000000..acb0531
--- /dev/null
@@ -0,0 +1,34 @@
+Name:       itest-cases-mic
+Summary:    Cases for mic functional testing
+Version:    0.1
+Release:    1
+Group:      Development/Tools/Other
+License:    GPLv2
+Source0:    %{name}_%{version}.tar.gz
+
+BuildArch:  noarch
+%if 0%{?suse_version}
+BuildRequires:  sudo
+%endif
+
+Requires: tar
+Requires: man
+Requires: unzip
+Requires: createrepo
+
+%description
+mic functional test cases in format of itest
+
+%prep
+%setup -q -n %{name}-%{version}
+
+%build
+make build
+
+%install
+make PREFIX=%{buildroot} install
+
+%files
+%defattr(-,root,root,-)
+/srv/itest/
+%{_sysconfdir}/sudoers.d/itest_cases_mic
diff --git a/report.html b/report.html
new file mode 100644 (file)
index 0000000..a8b7de8
--- /dev/null
@@ -0,0 +1,18 @@
+<%inherit file="base.html" />
+
+<%block name="after_overview">
+
+
+<h1 id="deps">Dependencies</h1>
+<table class="right">
+%for pkg, ver in status.deps:
+    <tr>
+        <th>${pkg}</th>
+        <td>${ver}</td>
+    </tr>
+%endfor
+</table>
+
+
+</%block>
+
diff --git a/settings.py b/settings.py
new file mode 100644 (file)
index 0000000..3bf825c
--- /dev/null
@@ -0,0 +1,73 @@
+import re
+import os
+import random
+import platform
+import subprocess
+
+from itest.utils import check_output
+
+
+CWD = os.path.dirname(os.path.abspath(__file__))
+
+SUDO_PASSWD = os.environ.get('ITEST_SUDO_PASSWD', '123456')
+RUN_CASE_TIMEOUT=60*60*3
+HANGING_TIMEOUT = 15 * 60 # 15 minutes
+TZ = 'Asia/Shanghai'
+
+def sample_files(path, k, predict=None):
+    def find_files(top):
+        for dirpath, _dirnames, filenames in os.walk(top):
+            for name in filenames:
+                path = os.path.join(dirpath, name)
+                if not predict or predict(path):
+                    yield path
+
+    files = list(find_files(path))
+    idx = random.sample(range(0, len(files)), min(k, len(files)))
+    return [ files[i] for i in idx ]
+
+def is_bootstrap_file(case_path):
+    cases = subprocess.Popen('grep native %s' % (case_path), shell=True, stdout=subprocess.PIPE).communicate()[0]
+    return cases == ''
+
+def random_tests(predict=None):
+    path = os.path.join(CWD, 'cases')
+    def squrash(a, b):
+        a.extend(b)
+        return a
+    return reduce(squrash, [ sample_files(os.path.join(path, comp), 2, predict)
+        for comp in os.listdir(path) ])
+
+
+def get_specific_cases(type):
+    if type == 'native':
+        cmd = "grep 'runtime=native' cases/create/ -rl"
+    elif type == 'bootstrap':
+        cmd = "grep 'runtime=native' cases/create/ -rL"
+    elif type == 'fast':
+        cases = [ 'cases/create/func_cases/mic_cr_auto_raw.case',
+                  'cases/create/func_cases/mic_cr_auto_loop.case' ]
+        for case in cases:
+            full_path = os.path.join(CWD, case)
+            cases[cases.index(case)] = full_path
+        return cases
+    proc = subprocess.Popen(cmd,
+                            shell=True,
+                            stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    stdout, stderr = proc.communicate()
+    cases = stdout.split()
+    for case in cases:
+        full_path = os.path.join(CWD, case)
+        cases[cases.index(case)] = full_path
+    return cases
+
+SUITES = {
+    'random': random_tests(),
+    'fast': random_tests(is_bootstrap_file),
+    #'ref-updated': 'fast',
+    #'patchset-created': 'fast',
+    'ref-updated': get_specific_cases('fast'),
+    'patchset-created': get_specific_cases('fast'),
+    'bootstrap': get_specific_cases('bootstrap'),
+    'native': get_specific_cases('native')
+}
diff --git a/sudoers.itest_cases_mic b/sudoers.itest_cases_mic
new file mode 100644 (file)
index 0000000..66f46f9
--- /dev/null
@@ -0,0 +1,37 @@
+Cmnd_Alias RM = /bin/rm
+Cmnd_Alias MIC  = /bin/mic, /usr/bin/mic, /usr/local/bin/mic
+Cmnd_Alias TEST = /bin/test, /usr/bin/test
+Cmnd_Alias SETENFORCE = /bin/setenforce, /usr/sbin/setenforce
+Cmnd_Alias TAR = /bin/tar, /usr/bin/tar
+Cmnd_Alias BUNZIP2 = /bin/bunzip2, /usr/bin/bunzip2
+Cmnd_Alias MKDIR = /usr/bin/mkdir, /bin/mkdir
+Cmnd_Alias WHICH = /usr/bin/which
+Cmnd_Alias KPARTX = /sbin/kpartx, /usr/sbin/kpartx
+Cmnd_Alias UMOUNT = /bin/umount, /usr/bin/umount
+Cmnd_Alias MOUNT = /bin/mount, /usr/bin/mount
+Cmnd_Alias LOSETUP = /sbin/losetup, /usr/sbin/losetup
+Cmnd_Alias PARTED = /sbin/parted, /usr/sbin/parted
+Cmnd_Alias BLKID = /sbin/blkid, /usr/sbin/blkid
+Cmnd_Alias CHROOT = /usr/sbin/chroot, /usr/bin/chroot
+Cmnd_Alias CREATEREPO = /usr/bin/createrepo
+Cmnd_Alias XARGS = /usr/bin/xargs
+Cmnd_Alias GUNZIP = /bin/gunzip, /usr/bin/gunzip
+Cmnd_Alias UNZIP = /usr/bin/unzip
+Cmnd_Alias EGREP = /bin/egrep, /usr/bin/egrep
+Cmnd_Alias MV = /usr/bin/mv, /bin/mv
+Cmnd_Alias SPM = /usr/bin/spm
+Cmnd_Alias CP = /bin/cp, /usr/bin/cp
+Cmnd_Alias SED = /bin/sed, /usr/bin/sed
+Cmnd_Alias FDISK = /sbin/fdisk, /usr/sbin/fdisk
+Cmnd_Alias LZOP = /usr/bin/lzop
+Cmnd_Alias PYTHON = /usr/bin/python
+Cmnd_Alias LS = /bin/ls
+Cmnd_Alias MD5SUM = /usr/bin/md5sum
+Cmnd_Alias SHA1SUM = /usr/bin/sha1sum
+Cmnd_Alias SHA256SUM = /usr/bin/sha256sum
+Cmnd_Alias YUM = /usr/bin/yum
+Cmnd_Alias ZYPPER = /usr/bin/zypper
+Cmnd_Alias APTGET = /usr/bin/apt-get
+Cmnd_Alias RPM = /usr/bin/rpm, /bin/rpm
+build ALL=(ALL) NOPASSWD: MIC, TEST, RM, SETENFORCE, TAR, BUNZIP2, MKDIR, CHROOT, WHICH, KPARTX, UMOUNT, MOUNT, LOSETUP, PARTED, CREATEREPO, XARGS, BLKID, EGREP, GUNZIP, UNZIP, MV, CP, SED, FDISK, SPM, LZOP, PYTHON, LS, MD5SUM, SHA1SUM, SHA256SUM, YUM, ZYPPER, APTGET, RPM
+Defaults    env_keep+="http_proxy https_proxy no_proxy"
diff --git a/tmp_ignore/mic_cr_livecd_native_check_chroot.case b/tmp_ignore/mic_cr_livecd_native_check_chroot.case
new file mode 100644 (file)
index 0000000..63ea20f
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <version>1.0</version>
+  <summary>Test whether it is ok to chroot into the image</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <steps><![CDATA[
+sudo mic cr livecd gnome-live.ks --logfile=gnome.log --runtime=native
+test -f gnome.log
+grep 'Finished' gnome.log
+test -e ./mic-output/gnome-live*.iso
+bash -c "sudo mic chroot ./mic-output/gnome-live*.iso" << EOF
+echo "Checking chroot"
+ls
+pwd
+echo "It's ok to chroot,jump out"
+EOF
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm gnome.log
+]]></teardown>
+</testcase>
diff --git a/tmp_ignore/mic_cr_liveusb_native_check_chroot.case b/tmp_ignore/mic_cr_liveusb_native_check_chroot.case
new file mode 100644 (file)
index 0000000..eeeccf0
--- /dev/null
@@ -0,0 +1,24 @@
+<testcase>
+  <version>1.0</version>
+  <summary>Test whether it is ok to chroot into the image</summary>
+  <fixtures>
+    <copy src="ks_files/gnome-live.ks" />
+  </fixtures>
+  <steps><![CDATA[
+sudo mic cr liveusb gnome-live.ks --logfile=gnome.log --runtime=native
+test -f gnome.log
+grep 'Finished' gnome.log
+test -e ./mic-output/gnome-live*.usbimg
+bash -c "sudo mic chroot ./mic-output/gnome-live*.usbimg" << EOF
+echo "Checking chroot"
+ls
+pwd
+echo "It's ok to chroot,jump out"
+EOF
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo rm -rf ./mic-output
+sudo rm gnome.log
+]]></teardown>
+</testcase>
diff --git a/tmp_ignore/mic_cr_loop_conf_not_current_dir_ia32.case b/tmp_ignore/mic_cr_loop_conf_not_current_dir_ia32.case
new file mode 100644 (file)
index 0000000..178b3b3
--- /dev/null
@@ -0,0 +1,21 @@
+<testcase>
+  <summary>Test whether mic find the conf which is not under current dir or 'ks' dir when running in bootstrap mode.</summary>
+  <fixtures>
+    <copy src="ks_files/handset_blackbay.ks" />
+    <copy src="conf/mic.conf" />
+  </fixtures>
+  <steps><![CDATA[
+cp mic.conf /tmp
+sudo mic cr loop handset_blackbay.ks -c /tmp/mic.conf --logfile=mic.log -d -v
+grep "Finished" mic.log
+(! grep "cannot find config file" mic.log)
+ls | grep "my_mic-output"
+sudo test -e ./my_mic-output/platform.img
+]]></steps>
+  <teardown><![CDATA[
+echo "cleaning..."
+sudo test -e my_mic-output && rm -rf my_mic-output
+sudo test -e mic.log && sudo rm mic.log
+echo 'finish cleaning...'
+]]></teardown>
+</testcase>