├── .github └── workflows │ ├── ci.yml │ └── submit.yml ├── .gitignore ├── .rubocop.yml ├── .yardopts ├── COPYING ├── MAINTAINER ├── README.md ├── RPMNAME ├── Rakefile ├── check_schema.sh ├── doc ├── error_reporting.md ├── multipath.md ├── network_scenarios.md ├── profile_conversions.md ├── profile_fetching.md ├── profile_handling.md └── validation.md ├── modconfig ├── README.md ├── backup.desktop ├── files.desktop ├── general.desktop ├── partitioning.desktop ├── report.desktop ├── scripts.desktop ├── software.desktop └── upgrade.desktop ├── package ├── autoyast2.changes ├── autoyast2.spec └── autoyast_en_html.tar.bz2 ├── scripts ├── autoyast ├── autoyast-initscripts.service └── docteam_build.sh ├── src ├── autoyast-rnc │ ├── README.md │ ├── backup.rnc │ ├── classes-decl.rnc │ ├── classes-use.rnc │ ├── common.rnc │ ├── files.rnc │ ├── general.rnc │ ├── partitioning.rnc │ ├── profile-misc.rnc │ ├── pxe.rnc │ ├── reporting.rnc │ ├── rules.rnc │ ├── scripts.rnc │ ├── software.rnc │ └── upgrade.rnc ├── bin │ └── autoyast-initscripts.sh ├── clients │ ├── autoinst_files_finish.rb │ ├── autoinst_scripts1_finish.rb │ ├── autoinst_scripts2_finish.rb │ ├── autoyast.rb │ ├── ayast_probe.rb │ ├── ayast_setup.rb │ ├── classes_auto.rb │ ├── clone_system.rb │ ├── files_auto.rb │ ├── general_auto.rb │ ├── inst_autoconfigure.rb │ ├── inst_autoinit.rb │ ├── inst_autopost.rb │ ├── inst_autosetup.rb │ ├── inst_autosetup_upgrade.rb │ ├── inst_store_upgrade_software.rb │ ├── report_auto.rb │ ├── scripts_auto.rb │ ├── software_auto.rb │ └── storage_auto.rb ├── desktop │ ├── org.opensuse.yast.AutoYaST.desktop │ └── org.opensuse.yast.CloneSystem.desktop ├── fillup │ └── sysconfig.autoinstall ├── icons │ └── hicolor │ │ ├── scalable │ │ └── apps │ │ │ ├── yast-autoyast.svg │ │ │ ├── yast-files.svg │ │ │ ├── yast-general.svg │ │ │ ├── yast-report.svg │ │ │ └── yast-scripts.svg │ │ └── symbolic │ │ └── apps │ │ ├── yast-autoyast-symbolic.svg │ │ ├── yast-files-symbolic.svg │ │ ├── yast-general-symbolic.svg │ │ ├── yast-report-symbolic.svg │ │ └── yast-scripts-symbolic.svg ├── include │ └── autoinstall │ │ ├── classes.rb │ │ ├── common.rb │ │ ├── conftree.rb │ │ ├── dialogs.rb │ │ ├── general_dialogs.rb │ │ ├── helps.rb │ │ ├── io.rb │ │ ├── script_dialogs.rb │ │ ├── tree.rb │ │ └── xml.rb ├── lib │ └── autoinstall │ │ ├── activate_callbacks.rb │ │ ├── ask │ │ ├── dialog.rb │ │ ├── profile_reader.rb │ │ ├── question.rb │ │ ├── question_option.rb │ │ ├── runner.rb │ │ └── stage.rb │ │ ├── auto_sequence.rb │ │ ├── autoinst_profile │ │ ├── ask_list_section.rb │ │ ├── ask_section.rb │ │ ├── ask_selection_entry.rb │ │ └── script_section.rb │ │ ├── autosetup_helpers.rb │ │ ├── clients │ │ ├── autoinst_files_finish.rb │ │ ├── autoyast.rb │ │ ├── ayast_probe.rb │ │ ├── ayast_setup.rb │ │ ├── clone_system.rb │ │ ├── files_auto.rb │ │ ├── inst_autoinit.rb │ │ ├── inst_autosetup.rb │ │ ├── inst_autosetup_upgrade.rb │ │ ├── report_auto.rb │ │ ├── scripts_auto.rb │ │ └── software_auto.rb │ │ ├── dialogs │ │ ├── disk_selector.rb │ │ ├── question.rb │ │ └── storage.rb │ │ ├── entries │ │ ├── description.rb │ │ ├── description_sorter.rb │ │ └── registry.rb │ │ ├── importer.rb │ │ ├── package_searcher.rb │ │ ├── partitioning_preprocessor.rb │ │ ├── pkg_gpg_check_handler.rb │ │ ├── presenters.rb │ │ ├── presenters │ │ ├── drive.rb │ │ ├── drive_type.rb │ │ ├── partition.rb │ │ └── section.rb │ │ ├── profile_checker.rb │ │ ├── script.rb │ │ ├── script_runner.rb │ │ ├── storage_controller.rb │ │ ├── storage_proposal.rb │ │ ├── ui_state.rb │ │ ├── widgets │ │ ├── ask │ │ │ ├── check_box.rb │ │ │ ├── combo_box.rb │ │ │ ├── dialog.rb │ │ │ ├── field.rb │ │ │ ├── input_field.rb │ │ │ └── password_field.rb │ │ └── storage │ │ │ ├── add_drive_button.rb │ │ │ ├── add_partition_button.rb │ │ │ ├── bcache_backing_attrs.rb │ │ │ ├── bcache_backing_for.rb │ │ │ ├── bcache_device.rb │ │ │ ├── bcache_page.rb │ │ │ ├── boolean_selector.rb │ │ │ ├── btrfs_device.rb │ │ │ ├── btrfs_member_attrs.rb │ │ │ ├── btrfs_name.rb │ │ │ ├── btrfs_page.rb │ │ │ ├── btrfs_raid_level.rb │ │ │ ├── cache_mode.rb │ │ │ ├── chunk_size.rb │ │ │ ├── common_partition_attrs.rb │ │ │ ├── create.rb │ │ │ ├── create_subvolumes.rb │ │ │ ├── crypt_key.rb │ │ │ ├── crypt_method.rb │ │ │ ├── data_raid_level.rb │ │ │ ├── delete_section_button.rb │ │ │ ├── disk_device.rb │ │ │ ├── disk_page.rb │ │ │ ├── disk_usage.rb │ │ │ ├── disklabel.rb │ │ │ ├── drive_page.rb │ │ │ ├── enable_snapshots.rb │ │ │ ├── encryption_attrs.rb │ │ │ ├── filesystem.rb │ │ │ ├── filesystem_attrs.rb │ │ │ ├── format.rb │ │ │ ├── fstopt.rb │ │ │ ├── init_drive.rb │ │ │ ├── keep_unknown_lv.rb │ │ │ ├── label.rb │ │ │ ├── lv_name.rb │ │ │ ├── lvm_group.rb │ │ │ ├── lvm_page.rb │ │ │ ├── lvm_partition_attrs.rb │ │ │ ├── lvm_pv_attrs.rb │ │ │ ├── md_level.rb │ │ │ ├── metadata_raid_level.rb │ │ │ ├── mkfs_options.rb │ │ │ ├── mount.rb │ │ │ ├── mountby.rb │ │ │ ├── nfs_name.rb │ │ │ ├── nfs_page.rb │ │ │ ├── not_lvm_partition_attrs.rb │ │ │ ├── overview_tree.rb │ │ │ ├── overview_tree_pager.rb │ │ │ ├── parity_algorithm.rb │ │ │ ├── partition_general_tab.rb │ │ │ ├── partition_id.rb │ │ │ ├── partition_nr.rb │ │ │ ├── partition_page.rb │ │ │ ├── partition_tab.rb │ │ │ ├── partition_type.rb │ │ │ ├── partition_usage_tab.rb │ │ │ ├── pesize.rb │ │ │ ├── pool.rb │ │ │ ├── raid_attrs.rb │ │ │ ├── raid_name.rb │ │ │ ├── raid_page.rb │ │ │ ├── resize.rb │ │ │ ├── size.rb │ │ │ ├── size_selector.rb │ │ │ ├── stripes.rb │ │ │ ├── stripesize.rb │ │ │ ├── tmpfs_page.rb │ │ │ ├── used_as.rb │ │ │ ├── used_as_filesystem.rb │ │ │ ├── used_pool.rb │ │ │ ├── uuid.rb │ │ │ └── vg_device.rb │ │ ├── xml_checks.rb │ │ ├── xml_validator.rb │ │ ├── y2erb.rb │ │ └── yard_doc.rb ├── modules │ ├── AutoInstall.rb │ ├── AutoInstallRules.rb │ ├── AutoinstClass.rb │ ├── AutoinstClone.rb │ ├── AutoinstCommon.rb │ ├── AutoinstConfig.rb │ ├── AutoinstFile.rb │ ├── AutoinstFunctions.rb │ ├── AutoinstGeneral.rb │ ├── AutoinstPartPlan.rb │ ├── AutoinstScripts.rb │ ├── AutoinstSoftware.rb │ ├── AutoinstStorage.rb │ ├── Profile.rb │ └── ProfileLocation.rb └── scrconf │ ├── autoinstall.scr │ └── cfg_autoinstall.scr ├── test ├── AutoInstallRules_test.rb ├── AutoInstall_test.rb ├── AutoinstClass_test.rb ├── AutoinstConfig_test.rb ├── AutoinstFunctions_test.rb ├── AutoinstGeneral_test.rb ├── AutoinstPartPlan_test.rb ├── AutoinstScripts_test.rb ├── AutoinstSoftware_test.rb ├── ProfileLocation_test.rb ├── autoinst_clone_test.rb ├── autoinst_file_test.rb ├── autoinst_storage_test.rb ├── fixtures │ ├── autoconf.ycp │ ├── classes │ │ ├── classes.xml │ │ └── swap │ │ │ ├── largeswap.xml │ │ │ └── largeswap_noroot.xml │ ├── desktop_files │ │ ├── desktops.yml │ │ └── groups.yml │ ├── empty-autoconf.ycp │ ├── etc │ │ └── autoinstall │ │ │ └── classes.xml │ ├── instsys │ │ └── tmp │ │ │ ├── YaST2 │ │ │ ├── ask-default-value-scripts │ │ │ │ └── ask-value.sh │ │ │ ├── ask-scripts │ │ │ │ ├── ask.sh │ │ │ │ └── logs │ │ │ │ │ └── ask.sh.log │ │ │ └── pre-scripts │ │ │ │ ├── logs │ │ │ │ └── pre.sh.log │ │ │ │ └── pre.sh │ │ │ └── profile │ │ │ └── autoinst.xml │ ├── network │ │ ├── wicked.out │ │ └── wicked_partial.out │ ├── output │ │ ├── ip_route.out │ │ ├── partitions-dontmerge.xml │ │ ├── partitions-merged.xml │ │ └── wicked_output │ ├── profiles │ │ ├── invalid.xml │ │ ├── leap.xml │ │ ├── minimal.xml.asc │ │ ├── partitions.xml │ │ ├── ppc_partitions.xml │ │ ├── software.xml │ │ └── unhandled_and_obsolete.xml │ └── storage │ │ ├── autoyast_drive_examples.yml │ │ └── multipath.xml ├── include │ └── conftree_test.rb ├── lib │ ├── activate_callbacks_test.rb │ ├── auto_sequence_test.rb │ ├── autoinstall │ │ ├── ask │ │ │ ├── dialog_test.rb │ │ │ ├── profile_reader_test.rb │ │ │ ├── question_test.rb │ │ │ ├── runner_test.rb │ │ │ ├── script_section_test.rb │ │ │ └── stage_test.rb │ │ ├── autoinst_profile │ │ │ ├── ask_list_section_test.rb │ │ │ ├── ask_section_test.rb │ │ │ └── ask_selection_entry_test.rb │ │ ├── script_runner_test.rb │ │ └── widgets │ │ │ └── ask │ │ │ ├── check_box_test.rb │ │ │ ├── combo_box_test.rb │ │ │ ├── dialog_test.rb │ │ │ ├── input_field_test.rb │ │ │ └── password_field_test.rb │ ├── autosetup_helpers_test.rb │ ├── clients │ │ ├── autoinst_files_finish_test.rb │ │ ├── autoyast_test.rb │ │ ├── ayast_probe_test.rb │ │ ├── ayast_setup_test.rb │ │ ├── clone_system_test.rb │ │ ├── files_auto_test.rb │ │ ├── inst_autoinit_test.rb │ │ ├── inst_autosetup_test.rb │ │ ├── inst_autosetup_upgrade_test.rb │ │ ├── report_auto_test.rb │ │ ├── scripts_auto_test.rb │ │ └── software_auto_test.rb │ ├── dialogs │ │ ├── disk_selector_test.rb │ │ ├── question_test.rb │ │ └── storage_test.rb │ ├── entries │ │ ├── description_sorter_test.rb │ │ ├── description_test.rb │ │ └── registry_test.rb │ ├── importer_test.rb │ ├── package_searcher_test.rb │ ├── partitioning_preprocessor_test.rb │ ├── pkg_gpg_check_handler_test.rb │ ├── presenters │ │ └── partition_test.rb │ ├── profile_checker_test.rb │ ├── script_test.rb │ ├── storage_controller_test.rb │ ├── storage_proposal_test.rb │ ├── widgets │ │ └── storage │ │ │ ├── add_children_button_test.rb │ │ │ ├── add_drive_button_test.rb │ │ │ ├── bcache_backing_attrs_test.rb │ │ │ ├── bcache_backing_for_test.rb │ │ │ ├── bcache_device_test.rb │ │ │ ├── bcache_page_test.rb │ │ │ ├── boolean_selector_test.rb │ │ │ ├── btrfs_device_test.rb │ │ │ ├── btrfs_member_attrs_test.rb │ │ │ ├── btrfs_name_test.rb │ │ │ ├── btrfs_page_test.rb │ │ │ ├── btrfs_raid_level_test.rb │ │ │ ├── cache_mode_test.rb │ │ │ ├── chunk_size_test.rb │ │ │ ├── common_partition_attrs_test.rb │ │ │ ├── create_subvolumes_test.rb │ │ │ ├── create_test.rb │ │ │ ├── crypt_key_test.rb │ │ │ ├── crypt_method_test.rb │ │ │ ├── data_raid_level_test.rb │ │ │ ├── delete_section_button_test.rb │ │ │ ├── disk_device_test.rb │ │ │ ├── disk_page_test.rb │ │ │ ├── disk_usage_test.rb │ │ │ ├── disklabel_test.rb │ │ │ ├── drive_page_test.rb │ │ │ ├── enable_snapshots_test.rb │ │ │ ├── encryption_attrs_test.rb │ │ │ ├── filesystem_attrs_test.rb │ │ │ ├── filesystem_test.rb │ │ │ ├── format_test.rb │ │ │ ├── fstopt_test.rb │ │ │ ├── keep_unknown_lv_test.rb │ │ │ ├── label_test.rb │ │ │ ├── lvm_group_test.rb │ │ │ ├── lvm_page_test.rb │ │ │ ├── lvm_partition_attrs_test.rb │ │ │ ├── lvm_pv_attrs_test.rb │ │ │ ├── md_level_test.rb │ │ │ ├── metadata_raid_level_test.rb │ │ │ ├── mkfs_options_test.rb │ │ │ ├── mount_test.rb │ │ │ ├── mountby_test.rb │ │ │ ├── overview_tree_pager_test.rb │ │ │ ├── parity_algorithm_test.rb │ │ │ ├── partition_general_tab_test.rb │ │ │ ├── partition_id_test.rb │ │ │ ├── partition_nr_test.rb │ │ │ ├── partition_page_test.rb │ │ │ ├── partition_tab_test.rb │ │ │ ├── partition_type_test.rb │ │ │ ├── partition_usage_tab_test.rb │ │ │ ├── pesize_test.rb │ │ │ ├── pool_test.rb │ │ │ ├── raid_attrs_test.rb │ │ │ ├── raid_page_test.rb │ │ │ ├── resize_test.rb │ │ │ ├── shared_examples.rb │ │ │ ├── size_selector_test.rb │ │ │ ├── size_test.rb │ │ │ ├── stripes_test.rb │ │ │ ├── stripesize_test.rb │ │ │ ├── used_as_test.rb │ │ │ ├── used_pool_test.rb │ │ │ ├── uuid_test.rb │ │ │ └── vg_device_test.rb │ ├── xml_checks_test.rb │ ├── xml_validator_test.rb │ └── y2erb_test.rb ├── profile_test.rb ├── support │ ├── ask_helpers.rb │ └── storage_helpers.rb └── test_helper.rb ├── test_xml ├── README.md ├── ask.xml ├── ask2.xml ├── autoinst.xml ├── autoyast_bnc844761.xml ├── blog.xml ├── blown.xml ├── cc.xml ├── choose.xml ├── classes.xml ├── classes │ ├── eth0.xml │ ├── largeswap.xml │ ├── main.xml │ ├── out.xml │ ├── out2.xml │ ├── swap │ │ ├── largeswap.xml │ │ └── largeswap_noroot.xml │ └── vmware.xml ├── clone_sp1.xml ├── cobbler.xml ├── complex_partition.xml ├── deprecated_bootloader.xml ├── dynamic.erb ├── dynamic.xml ├── empty.xml ├── fehr_826384.xml ├── fehr_829265.xml ├── fehr_861091.xml ├── fehr_addon.xml ├── fehr_addon_ha.xml ├── fehr_ask_sle11.xml ├── fehr_btrfs_subvol.xml ├── fehr_files.xml ├── fehr_iscsi_client.xml ├── fehr_lvm.xml ├── fehr_lvm_conditional.xml ├── fehr_lvm_full_sdc.xml ├── fehr_lvm_reuse.xml ├── fehr_lvm_sles11_sda_disklvm.xml ├── fehr_lvm_sles12_sdb_full_sdcd.xml ├── fehr_lvm_thin.xml ├── fehr_minimal.xml ├── fehr_netrename.xml ├── fehr_pre_script.xml ├── fehr_raid.xml ├── fehr_raid5_nonames.xml ├── fehr_raid_SL11SP2.xml ├── fehr_raid_name_sdbc.xml ├── fehr_raid_reuse.xml ├── fehr_reuse_bnc852903.xml ├── fehr_reuse_sdb.xml ├── fehr_reuse_sdb_15.xml ├── fehr_reuse_sdb_15_init.xml ├── fehr_reuse_sdb_4p.xml ├── fehr_reuse_sdb_4p_init.xml ├── fehr_runlevel_sdb.xml ├── fehr_scrtest.xml ├── fehr_sda.xml ├── fehr_sda_854439.xml ├── fehr_sda_sle12.xml ├── fehr_sdb.xml ├── fehr_sdb_823224.xml ├── fehr_sdb_gpt_sle12.xml ├── fehr_sdb_lvm_ask.xml ├── fehr_sdb_lvmext.xml ├── fehr_sdb_ok.xml ├── fehr_sdb_pers.xml ├── fehr_sdb_sle11.xml ├── fehr_sdb_sle12.xml ├── fehr_sdb_use_2gap.xml ├── fehr_sles11_nfs.xml ├── fehr_test.xml ├── files.xml ├── fix.xml ├── grc.xml ├── ia64.xml ├── install_part1.xml ├── installedSystem.xml ├── jo.xml ├── lenovo.xml ├── lvm.xml ├── mctest.xml ├── min.xml ├── modify.xml ├── my_clone.xml ├── part1.xml ├── part1_complex.xml ├── part1_enc.xml ├── part1a.xml ├── part2.xml ├── part3.xml ├── part4.xml ├── part5.xml ├── part6.xml ├── part7.xml ├── part_fstab.xml ├── part_pre-script.xml ├── part_test.xml ├── part_test2.xml ├── raid_complex.xml ├── resize.xml ├── reuse_create.xml ├── reuse_evms.xml ├── reuse_use.xml ├── rules │ ├── big.xml │ ├── classes │ │ ├── eth0.xml │ │ ├── main.xml │ │ ├── out.xml │ │ ├── out2.xml │ │ └── vmware.xml │ ├── kde.xml │ ├── minimal.xml │ ├── rest.xml │ ├── rules.xml.old │ ├── rules.xml.old2 │ ├── rules.xml.old3 │ ├── rules.xml.save │ └── rules.xml.test ├── s390.xml ├── sap.xml ├── scripts │ ├── chroot_script_test.sh │ ├── chroot_script_test2.sh │ ├── file_script.sh │ ├── init_script_test2.sh │ ├── post_script_test.sh │ ├── post_script_test2.sh │ ├── postpart_script_test.sh │ └── pre_script_test.sh ├── simple.xml ├── sled11sp2-autoinst.xml ├── sles-base.xml ├── sles11-sp1-32.xml ├── sles9.xml ├── software_with_addon.xml ├── susecz4.xml ├── sysconfig.xml ├── test.xml ├── test2.xml ├── test3.xml ├── testing.xml ├── ug_raid.xml ├── ui-test.xml ├── upgrade.xml ├── users.xml ├── varkoly.xml ├── vnc_test.xml └── xinclude_incl.xml └── xslt ├── merge.xslt ├── new_types.xslt ├── old_types.xslt └── rng ├── convert ├── runlevels.rnc ├── samba.rnc ├── simplify-types └── sound.rnc /.github/workflows/submit.yml: -------------------------------------------------------------------------------- 1 | # See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions 2 | 3 | name: OBS 4 | 5 | on: 6 | # only when committing to master 7 | push: 8 | branches: master 9 | 10 | # allow running manually from GitHub Web 11 | workflow_dispatch: 12 | 13 | jobs: 14 | submit: 15 | # do not run in forks 16 | if: github.repository_owner == 'yast' 17 | 18 | runs-on: ubuntu-latest 19 | 20 | # the default timeout is 6 hours, do not wait for that long if osc gets stucked 21 | timeout-minutes: 30 22 | 23 | steps: 24 | - name: Submit the package 25 | # see https://github.com/yast/actions/blob/master/submit/action.yml 26 | uses: yast/actions/submit@master 27 | with: 28 | obs_user: ${{ secrets.OBS_USER }} 29 | obs_password: ${{ secrets.OBS_PASSWORD }} 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | /Makefile.am 3 | Makefile.in 4 | aclocal.m4 5 | autom4te.cache 6 | config.cache 7 | config.guess 8 | config.h 9 | config.h.in 10 | config.log 11 | config.status 12 | config.sub 13 | configure 14 | configure.ac 15 | configure.in 16 | depcomp 17 | install-sh 18 | libtool 19 | ltconfig 20 | ltmain.sh 21 | missing 22 | mkinstalldirs 23 | stamp-h* 24 | *.pot 25 | *.ami 26 | .dep 27 | Makefile.am.common 28 | doc/build 29 | doc/html 30 | doc/elements.xml 31 | doc/autodocs/ 32 | doc/xml/components.ent 33 | doc/xml/examples.ent 34 | doc/xml/images.ent 35 | doc/xml/ay_bigfile*.xml 36 | doc/xml/html 37 | doc/css 38 | doc/js 39 | doc/*.html 40 | src/modules/dialogs/autoinstall 41 | src/modules/include/autoinstall 42 | package/autoyast2-*.bz2 43 | /.yardoc 44 | /coverage 45 | /test-driver 46 | -------------------------------------------------------------------------------- /.yardopts: -------------------------------------------------------------------------------- 1 | --no-private 2 | --protected 3 | --markup markdown 4 | --readme README.md 5 | --output-dir ./doc/autodocs 6 | --files doc/*.md 7 | src/**/*.rb 8 | -------------------------------------------------------------------------------- /MAINTAINER: -------------------------------------------------------------------------------- 1 | Deprecated file. Use `osc maintainer autoyast2` instead. 2 | -------------------------------------------------------------------------------- /RPMNAME: -------------------------------------------------------------------------------- 1 | autoyast2 2 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "yast/rake" 2 | 3 | AUTOINST_DIR = Packaging::Configuration::DESTDIR + "/usr/share/autoinstall/" 4 | 5 | Yast::Tasks.configuration do |conf| 6 | # lets ignore license check for now 7 | conf.skip_license_check << /.*/ 8 | conf.install_locations["scripts/*.service"] = 9 | Packaging::Configuration::DESTDIR + "/usr/lib/systemd/system/" 10 | conf.install_locations["xslt/*.xslt"] = AUTOINST_DIR + "/xslt/" 11 | conf.install_locations["modconfig/*.desktop"] = AUTOINST_DIR + "/modules/" 12 | conf.install_locations["control/*.xml"] = Packaging::Configuration::YAST_DIR + "/control/" 13 | end 14 | 15 | def make_dir(dir) 16 | sh "/usr/bin/install -d -m 700 #{Packaging::Configuration::DESTDIR}/#{dir}" 17 | end 18 | 19 | # define additional creation of directories during installation 20 | task :install do 21 | make_dir "/etc/autoinstall" 22 | make_dir "/var/adm/autoinstall/scripts" 23 | make_dir "/var/adm/autoinstall/init.d" 24 | make_dir "/var/adm/autoinstall/logs" 25 | make_dir "/var/adm/autoinstall/files" 26 | make_dir "/var/adm/autoinstall/cache" 27 | make_dir "/var/lib/autoinstall/repository/templates" 28 | make_dir "/var/lib/autoinstall/repository/rules" 29 | make_dir "/var/lib/autoinstall/repository/classes" 30 | make_dir "/var/lib/autoinstall/autoconf" 31 | make_dir "/var/lib/autoinstall/tmp" 32 | # remove git only readme 33 | sh "rm #{Packaging::Configuration::YAST_DIR}/schema/autoyast/rnc/README.md" 34 | end 35 | -------------------------------------------------------------------------------- /check_schema.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This script checks that all RNC files can be converted to RNG without errors. 4 | 5 | # Fail if trang is missing 6 | if ! which trang > /dev/null; then 7 | echo 'ERROR: "trang" tool is missing' 8 | exit 1 9 | fi 10 | 11 | # explicitly check the RNC schema files for errors 12 | # (the files are defined here, but converted in yast2-schema) 13 | find . -name "*.rnc" -exec sh -c "echo 'Checking {}...'; trang -I rnc -O rng {} /dev/null" \; 2> trang.log 14 | 15 | # grep for "error" in the output, "trang" returns 0 exit status 16 | # even on an error :-( 17 | if grep -i -q error trang.log; then 18 | echo "Error in schema:" 19 | cat trang.log 20 | rm -f trang.log 21 | exit 1 22 | fi 23 | 24 | rm -f trang.log 25 | echo "OK" 26 | -------------------------------------------------------------------------------- /doc/profile_conversions.md: -------------------------------------------------------------------------------- 1 | # Profile Conversions 2 | 3 | Although AutoYaST keeps backward compatibility so the old profiles should work 4 | in new product releases in some cases it might be useful to do some conversions. 5 | 6 | ## :warning: Warning 7 | 8 | *The automatic conversions using XSLT might not produce exact 1:1 results, 9 | there might be minor differences in formatting, also the CDATA sections are 10 | converted to regular data.* 11 | 12 | *Always check the conversion result and adjust it manually if needed.* 13 | 14 | ## Converting from the Old Data Types to the New Ones 15 | 16 | Since SLE15-SP3 AutoYaST simplified the data type definitions in the XML 17 | profiles. 18 | 19 | Instead of `config:type="boolean"` you can use a shorter form `t="boolean"`, 20 | for example: 21 | 22 | ```xml 23 | true 24 | ``` 25 | 26 | To convert the data types automatically you can use the [`new_types.xslt`]( 27 | ../xslt/new_types.xslt) file. 28 | 29 | ```shell 30 | xsltproc -o profile_new.xml /usr/share/autoinstall/xslt/new_types.xslt profile.xml 31 | ``` 32 | 33 | ## Converting from the New Data Types to the Old Ones 34 | 35 | This is the opposite process to the previous conversion, it converts the new 36 | data types to the old ones. This is useful if you want to use a new profile 37 | in an old system (SLE15-SP2 and older). The old AutoYaST cannot read the new 38 | data types and it would fail. 39 | 40 | The [old_types.xslt](../xslt/old_types.xslt) file converts the short 41 | attributes `t="boolean"` to long attributes `config:type="boolean"`. 42 | 43 | ```shell 44 | xsltproc -o profile_old.xml /usr/share/autoinstall/xslt/old_types.xslt profile.xml 45 | ``` 46 | -------------------------------------------------------------------------------- /modconfig/README.md: -------------------------------------------------------------------------------- 1 | # AutoYaST-specific Desktop Files 2 | 3 | The files included in this directory are installed in the `/usr/share/autoinstall/modules` and are 4 | only used by AutoYaST. The format of those files is [documented in the yast2 5 | repository](https://github.com/yast/yast-yast2/blob/master/doc/desktop_file.md). Additionally, these 6 | files are used in order to decide which sections are included in the schema (check the 7 | `src/autoyast-rnc` directory for the schema definition files). 8 | -------------------------------------------------------------------------------- /modconfig/backup.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=backup 8 | 9 | X-SuSE-YaST-Group=System 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst=write 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstResource=backup 16 | X-SuSE-YaST-AutoInstPath=install 17 | X-SuSE-YaST-AutoInstSchema=backup.rnc 18 | 19 | Icon=yast-backup 20 | Exec= 21 | 22 | Name=Backup Options 23 | GenericName=Backup Autoinstallation Options 24 | StartupNotify=true 25 | -------------------------------------------------------------------------------- /modconfig/files.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=files 8 | 9 | X-SuSE-YaST-Group=Misc 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst=all 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstDataType=list 16 | X-SuSE-YaST-AutoInstSchema=files.rnc 17 | X-SuSE-YaST-AutoInstResource=files 18 | X-SuSE-YaST-AutoInstRequires=users,lan 19 | 20 | Icon=yast-files 21 | Exec= 22 | 23 | Name=Complete Configuration Files 24 | GenericName=Add Complete Configuration Files 25 | StartupNotify=true 26 | -------------------------------------------------------------------------------- /modconfig/general.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=general 8 | 9 | X-SuSE-YaST-Group=System 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst=configure 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstResource=general 16 | X-SuSE-YaST-AutoInstPath=install 17 | X-SuSE-YaST-AutoInstSchema=general.rnc 18 | 19 | Icon=yast-general 20 | Exec= 21 | 22 | Name=General Options 23 | GenericName=Configure General Autoinstallation Options 24 | StartupNotify=true 25 | -------------------------------------------------------------------------------- /modconfig/partitioning.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-System; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=partitioning 8 | 9 | X-SuSE-YaST-Group=System 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst=configure 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstResource=partitioning 16 | X-SuSE-YaST-AutoInstClient=storage_auto 17 | X-SuSE-YaST-AutoInstPath=install 18 | X-SuSE-YaST-AutoInstDataType=list 19 | X-SuSE-YaST-AutoInstSchema=partitioning.rnc 20 | X-SuSE-YaST-AutoInstClonable=true 21 | 22 | Icon=yast-disk 23 | Exec= 24 | 25 | Name=YaST Partitioner 26 | GenericName=Configure Partitioning and Storage Settings 27 | StartupNotify=true 28 | -------------------------------------------------------------------------------- /modconfig/report.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=report 8 | 9 | X-SuSE-YaST-Group=System 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst=configure 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstResource=report 16 | X-SuSE-YaST-AutoInstPath=install 17 | X-SuSE-YaST-AutoInstSchema=reporting.rnc 18 | 19 | Icon=yast-report 20 | Exec= 21 | 22 | Name=Reporting & Logging 23 | GenericName=Configure Reporting and Logging Options 24 | StartupNotify=true 25 | -------------------------------------------------------------------------------- /modconfig/scripts.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=scripts 8 | 9 | X-SuSE-YaST-Group=Misc 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst=configure 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstResource=scripts 16 | X-SuSE-YaST-AutoInstSchema=scripts.rnc 17 | 18 | Icon=yast-scripts 19 | Exec= 20 | 21 | Name=Custom Scripts 22 | GenericName=Add or Edit Custom Scripts 23 | StartupNotify=true 24 | -------------------------------------------------------------------------------- /modconfig/software.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=software 8 | 9 | X-SuSE-YaST-Group=Software 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst=configure 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstResource=software 16 | X-SuSE-YaST-AutoInstPath=install 17 | X-SuSE-YaST-AutoInstSchema=software.rnc 18 | X-SuSE-YaST-AutoInstClonable=true 19 | 20 | Icon=yast-sw_single 21 | Exec= 22 | 23 | Name=Package Selection 24 | GenericName=Configure Package Selection and Software Settings 25 | StartupNotify=true 26 | -------------------------------------------------------------------------------- /modconfig/upgrade.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=upgrade 8 | 9 | X-SuSE-YaST-Group=System 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst=write 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstResource=upgrade 16 | X-SuSE-YaST-AutoInstPath=install 17 | X-SuSE-YaST-AutoInstSchema=upgrade.rnc 18 | 19 | Icon=yast-upgrade 20 | Exec= 21 | 22 | Name=Upgrade Options 23 | GenericName=Upgrade Autoinstallation Options 24 | StartupNotify=true 25 | -------------------------------------------------------------------------------- /package/autoyast_en_html.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yast/yast-autoinstallation/c1443800dc1fb89a5fc33fbf1d046c6da13253cc/package/autoyast_en_html.tar.bz2 -------------------------------------------------------------------------------- /scripts/autoyast-initscripts.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Autoyast2 Init Scripts 3 | After=remote-fs.target network-online.target time-sync.target mail-transfer-agent.target hwscan.service ypbind.service YaST2-Second-Stage.service 4 | Before=getty@tty1.service serial-getty@ttyS0.service serial-getty@ttyS1.service serial-getty@ttyS2.service 5 | Before=serial-getty@hvc0.service serial-getty@ttyAMA0.service 6 | Before=display-manager.service systemd-user-sessions.service 7 | Wants=network-online.target 8 | 9 | [Service] 10 | Type=oneshot 11 | Environment=TERM=linux 12 | ExecStartPre=-/usr/bin/plymouth --hide-splash 13 | ExecStart=/usr/lib/YaST2/bin/autoyast-initscripts.sh 14 | RemainAfterExit=yes 15 | TimeoutSec=0 16 | 17 | [Install] 18 | WantedBy=default.target 19 | 20 | -------------------------------------------------------------------------------- /scripts/docteam_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | _exit_on_error () { 4 | echo "Error: $1" >&2 5 | exit 1 6 | } 7 | 8 | ENVFILE="ENV-autoyast" 9 | 10 | CHECKOUT_DIR=$(readlink -m $(dirname $0)) 11 | CHECKOUT_DIR=$(dirname $CHECKOUT_DIR) 12 | 13 | echo "Running make" 14 | 15 | cd $CHECKOUT_DIR 16 | make -f Makefile.cvs > /dev/null || _exit_on_error "Autogenerating Makefiles failed" 17 | 18 | cd ${CHECKOUT_DIR}/doc/xml 19 | make > /dev/null || _exit_on_error "Autogenerating docs failed" 20 | 21 | echo "Linking Images" 22 | mkdir -p ${CHECKOUT_DIR}/doc/images/src/png 23 | cd ${CHECKOUT_DIR}/doc/images/src/png 24 | for IMG in ../../../autoyast2/img/*.png; do 25 | ln -sf "$IMG" || "Warning: could not link $IMG" 26 | done 27 | 28 | cd ${CHECKOUT_DIR}/doc/xml 29 | 30 | echo "Creating bigfile" 31 | xmllint --xinclude --postvalid --noent --output ay_bigfile.xml autoyast.xml || _exit_on_error "Failed to create bigfile" 32 | sed -i 's:\(fileref="\)img/:\1:g' ay_bigfile.xml 33 | 34 | 35 | 36 | cd ${CHECKOUT_DIR}/doc 37 | 38 | mkdir -p ${CHECKOUT_DIR}/doc/docteam 39 | 40 | echo "Creating PDF" 41 | daps -e "$ENVFILE" --builddir ${CHECKOUT_DIR}/doc/docteam color-pdf 42 | 43 | echo "Creating HTML" 44 | daps -e "$ENVFILE" --builddir ${CHECKOUT_DIR}/doc/docteam html 45 | 46 | echo "Creating Source tarballs" 47 | daps -e "$ENVFILE" --builddir ${CHECKOUT_DIR}/doc/docteam package-src -------------------------------------------------------------------------------- /src/autoyast-rnc/README.md: -------------------------------------------------------------------------------- 1 | ## Relax NG Schema 2 | 3 | See [doc/validation.md: Profile Validation](../../doc/validation.md). 4 | 5 | ### Validating the Schema Itself 6 | 7 | (Or, Who will guard the guards themselves?) 8 | 9 | See [check_schema.sh](../../check_schema.sh) at the root of this repo, 10 | which is run as part of a [CI GH Action](../../.github/workflows/ci.yml). 11 | 12 | To run it yourself you may need to install the tools: 13 | 14 | ```sh 15 | zypper install trang 16 | ``` 17 | -------------------------------------------------------------------------------- /src/autoyast-rnc/backup.rnc: -------------------------------------------------------------------------------- 1 | default namespace = "http://www.suse.com/1.0/yast2ns" 2 | namespace config = "http://www.suse.com/1.0/configns" 3 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 4 | 5 | backup = 6 | element backup { 7 | MAP, 8 | ( 9 | element modified { BOOLEAN }? & 10 | element remove_old { BOOLEAN }? & 11 | element sysconfig { BOOLEAN }? 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /src/autoyast-rnc/classes-decl.rnc: -------------------------------------------------------------------------------- 1 | # Declaration of classes for the UI 2 | # 3 | # Do not confuse with classes-use.rn[cg] 4 | # which describes the use of classes in a profile 5 | 6 | default namespace = "http://www.suse.com/1.0/yast2ns" 7 | namespace config = "http://www.suse.com/1.0/configns" 8 | 9 | include "common.rnc" 10 | 11 | autoinstall = element autoinstall { MAP, classes } 12 | classes = 13 | element classes { 14 | LIST, 15 | class+ 16 | } 17 | class = 18 | element class { 19 | description& 20 | name& 21 | order 22 | } 23 | description = element description { STRING } 24 | name = element name { STRING } 25 | order = element order { INTEGER } 26 | 27 | start = autoinstall 28 | -------------------------------------------------------------------------------- /src/autoyast-rnc/classes-use.rnc: -------------------------------------------------------------------------------- 1 | # This describes a part of the autoinstallation profile. 2 | # 3 | # Do not confuse with classes-decl.rn[cg] which declares 4 | # the classes for the UI. 5 | default namespace = "http://www.suse.com/1.0/yast2ns" 6 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 7 | namespace config = "http://www.suse.com/1.0/configns" 8 | 9 | include "common.rnc" 10 | 11 | classes = 12 | element classes { 13 | LIST, 14 | class* 15 | } 16 | 17 | class = 18 | element class { 19 | MAP, 20 | ( 21 | class_name & 22 | configuration & 23 | element dont_merge { 24 | LIST, 25 | element element { STRING }* 26 | }? 27 | ) 28 | } 29 | 30 | class_name = 31 | element class_name { STRING } 32 | configuration = 33 | element configuration { STRING } 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/autoyast-rnc/files.rnc: -------------------------------------------------------------------------------- 1 | # 2 | 3 | default namespace = "http://www.suse.com/1.0/yast2ns" 4 | namespace config = "http://www.suse.com/1.0/configns" 5 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 6 | 7 | include "common.rnc" 8 | 9 | file_src = file_contents 10 | | file_location 11 | files = 12 | element files { 13 | LIST, 14 | element file { 15 | MAP, 16 | ( 17 | file_src? & 18 | file_path & 19 | file_permissions? & 20 | file_owner? & 21 | file_script? 22 | ) 23 | }+ 24 | } 25 | file_contents = element file_contents { STRING } 26 | file_location = element file_location { STRING } 27 | file_path = element file_path { STRING } 28 | file_permissions = element file_permissions { STRING } 29 | file_owner = element file_owner { STRING } 30 | file_script = element file_script { MAP, (interpreter & source? & element location { STRING }? ) } 31 | -------------------------------------------------------------------------------- /src/autoyast-rnc/pxe.rnc: -------------------------------------------------------------------------------- 1 | default namespace = "http://www.suse.com/1.0/yast2ns" 2 | namespace config = "http://www.suse.com/1.0/configns" 3 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 4 | 5 | include "common.rnc" 6 | 7 | pxe = element pxe { 8 | MAP, 9 | ( 10 | element pxe_localboot { BOOLEAN }? & 11 | element pxelinux-config { STRING }? & 12 | element tftp-server { STRING }? & 13 | element pxelinux-dir { STRING }? 14 | ) 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/autoyast-rnc/reporting.rnc: -------------------------------------------------------------------------------- 1 | # 2 | 3 | default namespace = "http://www.suse.com/1.0/yast2ns" 4 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 5 | namespace config = "http://www.suse.com/1.0/configns" 6 | 7 | include "common.rnc" 8 | 9 | report = element report { MAP, (errors? & messages? & warnings? & yesno_messages?) } 10 | errors = element errors { MAP, (log? & show? & timeout?) } 11 | yesno_messages = element yesno_messages { MAP, (log? & show? & timeout?) } 12 | messages = element messages { MAP, (log? & show? & timeout?) } 13 | warnings = element warnings { MAP, (log? & show? & timeout?) } 14 | # 15 | log = 16 | element log { BOOLEAN } 17 | show = 18 | element show { BOOLEAN } 19 | timeout = 20 | element timeout { INTEGER } 21 | -------------------------------------------------------------------------------- /src/autoyast-rnc/software.rnc: -------------------------------------------------------------------------------- 1 | default namespace = "http://www.suse.com/1.0/yast2ns" 2 | namespace config = "http://www.suse.com/1.0/configns" 3 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 4 | 5 | include "common.rnc" 6 | 7 | software = 8 | element software { 9 | MAP, 10 | ( 11 | kernel? & 12 | packages? & 13 | post-packages? & 14 | post-patterns? & 15 | remove-packages? & 16 | patterns? & 17 | remove-patterns? & 18 | products? & 19 | remove-products? & 20 | element do_online_update { BOOLEAN }? & 21 | element install_recommended { BOOLEAN }? & 22 | element instsource {STRING}? 23 | ) 24 | } 25 | patterns = 26 | element patterns { 27 | LIST, 28 | element (pattern | listentry) { STRING }+ 29 | } 30 | kernel = element kernel { STRING } 31 | post-packages = 32 | element post-packages { 33 | LIST, 34 | element (package | listentry) {STRING}+ 35 | } 36 | post-patterns = 37 | element post-patterns { 38 | LIST, 39 | element (pattern | listentry) {STRING}+ 40 | } 41 | packages = 42 | element packages { 43 | LIST, 44 | element (package | listentry) {STRING}+ 45 | } 46 | remove-packages = 47 | element remove-packages { 48 | LIST, 49 | element (package | listentry) {STRING}+ 50 | } 51 | remove-patterns = 52 | element remove-patterns { 53 | LIST, 54 | element (pattern | listentry) {STRING}+ 55 | } 56 | products = 57 | element products { 58 | LIST, 59 | element (product | listentry) {STRING}+ 60 | } 61 | remove-products = 62 | element remove-products { 63 | LIST, 64 | element (product | listentry) {STRING}+ 65 | } 66 | -------------------------------------------------------------------------------- /src/autoyast-rnc/upgrade.rnc: -------------------------------------------------------------------------------- 1 | default namespace = "http://www.suse.com/1.0/yast2ns" 2 | namespace config = "http://www.suse.com/1.0/configns" 3 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 4 | 5 | upgrade = 6 | element upgrade { 7 | MAP, 8 | ( 9 | element stop_on_solver_conflict { BOOLEAN }? 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /src/bin/autoyast-initscripts.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Copyright (c) 2012 SUSE Linux AG, Nuernberg, Germany. 3 | # All rights reserved. 4 | # 5 | # Author: Thomas Fehr 6 | # Please send feedback to http://www.suse.de/feedback/ 7 | # 8 | 9 | 10 | LOG_DIR="/var/adm/autoinstall/logs" 11 | SCRIPT_DIR="/var/adm/autoinstall/scripts" 12 | INITSCRIPT_DIR="/var/adm/autoinstall/init.d" 13 | 14 | systemctl disable autoyast-initscripts.service 15 | 16 | if [ ! -d "$INITSCRIPT_DIR" ]; then 17 | exit 1 18 | fi 19 | 20 | for script in `find $INITSCRIPT_DIR -type f`; do 21 | CONTINUE=1 22 | done 23 | 24 | if [ -z "$CONTINUE" ]; then 25 | exit 0 26 | fi 27 | 28 | for script in `find $INITSCRIPT_DIR -type f |sort`; do 29 | echo -n "Executing AutoYaST script: $script" 30 | BASENAME=`basename $script` 31 | sh -x $script > $LOG_DIR/$BASENAME.log 2>&1 32 | mv $script $SCRIPT_DIR 33 | done 34 | -------------------------------------------------------------------------------- /src/clients/autoinst_files_finish.rb: -------------------------------------------------------------------------------- 1 | require "autoinstall/clients/autoinst_files_finish" 2 | 3 | Y2Autoinstallation::Clients::AutoinstFilesFinish.run 4 | -------------------------------------------------------------------------------- /src/clients/autoyast.rb: -------------------------------------------------------------------------------- 1 | # File: clients/autoyast.ycp 2 | # Summary: Main file for client call 3 | # Authors: Anas Nashif 4 | 5 | require "autoinstall/clients/autoyast" 6 | Y2Autoinstallation::Clients::Autoyast.new.main 7 | -------------------------------------------------------------------------------- /src/clients/ayast_probe.rb: -------------------------------------------------------------------------------- 1 | require "autoinstall/clients/ayast_probe" 2 | Y2Autoinstall::Clients::AyastProbe.new.main 3 | -------------------------------------------------------------------------------- /src/clients/clone_system.rb: -------------------------------------------------------------------------------- 1 | # File: clients/clone_system.ycp 2 | # Package: Auto-installation 3 | # Author: Uwe Gansert 4 | # Summary: This client is clones some settings of the 5 | # system. 6 | 7 | require "autoinstall/clients/clone_system" 8 | Y2Autoinstallation::Clients::CloneSystem.new.main 9 | -------------------------------------------------------------------------------- /src/clients/files_auto.rb: -------------------------------------------------------------------------------- 1 | require "autoinstall/clients/files_auto" 2 | 3 | Y2Autoinstallation::Clients::FilesAuto.run 4 | -------------------------------------------------------------------------------- /src/clients/inst_autoinit.rb: -------------------------------------------------------------------------------- 1 | require "autoinstall/clients/inst_autoinit" 2 | 3 | Y2Autoinstallation::Clients::InstAutoinit.run 4 | -------------------------------------------------------------------------------- /src/clients/inst_autosetup.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2013-2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "autoinstall/clients/inst_autosetup" 21 | Y2Autoinstallation::Clients::InstAutosetup.new.main 22 | -------------------------------------------------------------------------------- /src/clients/inst_autosetup_upgrade.rb: -------------------------------------------------------------------------------- 1 | require "autoinstall/clients/inst_autosetup_upgrade" 2 | 3 | Y2Autoinstallation::Clients::InstAutosetupUpgrade.new.main 4 | -------------------------------------------------------------------------------- /src/clients/report_auto.rb: -------------------------------------------------------------------------------- 1 | require "autoinstall/clients/report_auto" 2 | 3 | Y2Autoinstallation::Clients::ReportAuto.run 4 | -------------------------------------------------------------------------------- /src/clients/scripts_auto.rb: -------------------------------------------------------------------------------- 1 | require "autoinstall/clients/scripts_auto" 2 | 3 | Y2Autoinstallation::Clients::ScriptsAuto.run 4 | -------------------------------------------------------------------------------- /src/clients/software_auto.rb: -------------------------------------------------------------------------------- 1 | # File: clients/autoinst_software.ycp 2 | # Package: Autoinstallation Configuration System 3 | # Authors: Anas Nashif (nashif@suse.de) 4 | # Summary: Handle Package selections and packages 5 | 6 | require "autoinstall/clients/software_auto" 7 | Y2Autoinstallation::Clients::SoftwareAuto.new.main 8 | -------------------------------------------------------------------------------- /src/desktop/org.opensuse.yast.AutoYaST.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=autoyast 8 | 9 | X-SuSE-YaST-Group=Misc 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst= 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstResource= 16 | X-SuSE-YaST-Keywords=autoyast,installation 17 | 18 | Icon=yast-autoyast 19 | Exec=/usr/bin/xdg-su -c '/sbin/yast2 autoyast' 20 | 21 | Name=YaST Autoinstallation 22 | GenericName=Autoinstallation Configuration 23 | Comment=Configuration system for autoinstallation 24 | StartupNotify=true 25 | -------------------------------------------------------------------------------- /src/desktop/org.opensuse.yast.CloneSystem.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc; 4 | 5 | X-KDE-ModuleType=Library 6 | X-KDE-HasReadOnlyMode=true 7 | X-SuSE-YaST-Call=clone_system 8 | 9 | X-SuSE-YaST-Group=Misc 10 | X-SuSE-YaST-Argument= 11 | X-SuSE-YaST-RootOnly=true 12 | X-SuSE-YaST-AutoInst= 13 | X-SuSE-YaST-Geometry= 14 | X-SuSE-YaST-SortKey= 15 | X-SuSE-YaST-AutoInstResource= 16 | X-SuSE-YaST-Keywords=autoyast,installation,clone 17 | 18 | Icon=yast-autoyast 19 | Exec=/usr/bin/xdg-su -c '/sbin/yast2 clone_system' 20 | 21 | Name=YaST Clone System 22 | GenericName=Autoinstallation Cloning System 23 | Comment=Create an AutoYaST configuration file for cloning the system 24 | StartupNotify=true 25 | -------------------------------------------------------------------------------- /src/fillup/sysconfig.autoinstall: -------------------------------------------------------------------------------- 1 | ## Path: System/Yast2/Autoyast 2 | ## Description: AutoYaST default repository locations and misc. configuration options 3 | ## Type: string 4 | ## Default: /var/lib/autoinstall/repository 5 | # 6 | # Repository with all profiles 7 | # 8 | REPOSITORY="/var/lib/autoinstall/repository" 9 | 10 | ## Type: string 11 | ## Default: /var/lib/autoinstall/classes 12 | # 13 | # Classes 14 | # 15 | CLASS_DIR="/var/lib/autoinstall/repository/classes" 16 | ## Type: string 17 | ## Default: "addon,conf" 18 | # 19 | # lists not to be merged, instead they will be "added" 20 | # 21 | XSLT_DONTMERGE="addon,conf" 22 | 23 | ## Type: string 24 | ## Default: "add-on,suse_register,partitioning,bootloader,general,report,software" 25 | # 26 | # these modules don't support the "write now to system" feature of the 27 | # AutoYaST UI 28 | # 29 | FORBID_WRITENOW="add-on,suse_register,partitioning,bootloader,general,report,software" 30 | 31 | ## Type: string 32 | ## Default: "firewall" 33 | # 34 | # Listed modules have Edit button / action disabled at AutoYaST UI 35 | # 36 | FORBID_EDIT="" 37 | -------------------------------------------------------------------------------- /src/icons/hicolor/scalable/apps/yast-files.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/icons/hicolor/scalable/apps/yast-report.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/icons/hicolor/symbolic/apps/yast-autoyast-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/icons/hicolor/symbolic/apps/yast-files-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/icons/hicolor/symbolic/apps/yast-general-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/icons/hicolor/symbolic/apps/yast-report-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/icons/hicolor/symbolic/apps/yast-scripts-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/include/autoinstall/io.rb: -------------------------------------------------------------------------------- 1 | # File: include/autoinstall/io.ycp 2 | # Package: Autoinstallation Configuration System 3 | # Summary: I/O 4 | # Authors: Anas Nashif 5 | # 6 | # $Id$ 7 | 8 | require "transfer/file_from_url" 9 | 10 | module Yast 11 | module AutoinstallIoInclude 12 | # include basename, dirname, get_file_from_url 13 | include Yast::Transfer::FileFromUrl 14 | 15 | def initialize_autoinstall_io(_include_target) 16 | Yast.import "AutoinstConfig" 17 | end 18 | 19 | # Get control files from different sources 20 | # @return [Boolean] true on success 21 | def Get(scheme, host, urlpath, localfile) 22 | get_file_from_url(scheme: scheme, host: host, urlpath: urlpath, 23 | localfile: localfile, 24 | urltok: AutoinstConfig.urltok, 25 | destdir: AutoinstConfig.destdir) 26 | end 27 | 28 | # Get a file froma given URL 29 | def GetURL(url, target) 30 | AutoinstConfig.urltok = URL.Parse(url) 31 | toks = deep_copy(AutoinstConfig.urltok) 32 | Get( 33 | Ops.get_string(toks, "scheme", ""), 34 | Ops.get_string(toks, "host", ""), 35 | Ops.get_string(toks, "path", ""), 36 | target 37 | ) 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/ask/question_option.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | module Y2Autoinstall 21 | module Ask 22 | class QuestionOption 23 | attr_reader :value, :label 24 | 25 | # @param value [String] Question value 26 | # @param label [String,nil] Human readable representation. Used instead of the 27 | # 'value' if defined. 28 | def initialize(value, label = nil) 29 | @value = value 30 | @label = label 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /src/lib/autoinstall/ask/stage.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | module Y2Autoinstall 21 | module Ask 22 | class Stage 23 | # Return the stage corresponding to the given name 24 | # 25 | # @raise UnknownStage 26 | def self.from_name(name) 27 | KNOWN_STAGES.find { |s| s.name == name } 28 | end 29 | 30 | # Stage name 31 | attr_reader :name 32 | 33 | def initialize(name) 34 | @name = name 35 | end 36 | 37 | # Determines whether two objects are equivalent 38 | # 39 | # @param other [Stage] Stage to compare with 40 | # @return [Boolean] 41 | def ==(other) 42 | name == other.name 43 | end 44 | 45 | INITIAL = new("initial").freeze 46 | CONT = new("cont").freeze 47 | 48 | KNOWN_STAGES = [INITIAL, CONT].freeze 49 | private_constant :KNOWN_STAGES 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /src/lib/autoinstall/autoinst_profile/ask_selection_entry.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "installation/autoinst_profile/section_with_attributes" 21 | 22 | module Y2Autoinstall 23 | module AutoinstProfile 24 | class AskSelectionEntry < ::Installation::AutoinstProfile::SectionWithAttributes 25 | def self.attributes 26 | [ 27 | { name: :value, allow_blank: true }, 28 | { name: :label, allow_blank: true } 29 | ] 30 | end 31 | 32 | define_attr_accessors 33 | 34 | # @!attribute value 35 | # @return [String,nil] Entry value 36 | # 37 | # @!attribute label 38 | # @return [String,nil] Entry label 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /src/lib/autoinstall/clients/autoinst_files_finish.rb: -------------------------------------------------------------------------------- 1 | require "installation/finish_client" 2 | 3 | Yast.import "AutoinstFile" 4 | 5 | module Y2Autoinstallation 6 | module Clients 7 | class AutoinstFilesFinish < ::Installation::FinishClient 8 | def title 9 | textdomain "autoinst" 10 | _("Writing configuration files ...") 11 | end 12 | 13 | def modes 14 | [:autoinst] 15 | end 16 | 17 | def write 18 | ::Yast::AutoinstFile.Write 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /src/lib/autoinstall/presenters.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | module Y2Autoinstallation 21 | # Namespace for all the classes used to implement the Presentation Model pattern 22 | # See https://martinfowler.com/eaaDev/PresentationModel.html 23 | # 24 | # Also inspired by the Presenter pattern used in Ruby on Rails 25 | # See http://blog.jayfields.com/2007/03/rails-presenter-pattern.html 26 | module Presenters 27 | end 28 | end 29 | 30 | require "autoinstall/presenters/drive_type" 31 | require "autoinstall/presenters/drive" 32 | require "autoinstall/presenters/partition" 33 | -------------------------------------------------------------------------------- /src/lib/autoinstall/ui_state.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/ui_state" 22 | 23 | module Y2Autoinstallation 24 | # Singleton class to keep the position of the user in the UI and other similar 25 | # information that needs to be rememberd across UI redraws to give the user a 26 | # sense of continuity. 27 | class UIState < CWM::UIState 28 | # @see CWM::UIState#textdomain_name 29 | def textdomain_name 30 | "autoinst" 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/ask/input_field.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm" 22 | require "autoinstall/widgets/ask/field" 23 | 24 | module Y2Autoinstall 25 | module Widgets 26 | module Ask 27 | # Text field widget for questions 28 | # 29 | # @see Dialog 30 | class InputField < CWM::InputField 31 | include Field 32 | 33 | # @param question [Y2Autoinstall::Ask::Question] Question to represent 34 | def initialize(question) 35 | super() 36 | textdomain "autoinst" 37 | @question = question 38 | end 39 | 40 | # @macro seeAbstractWidget 41 | # This options are needed to notify the timer when the value changes 42 | # @see Y2Autoinstall::Widgets::Ask::Dialog::TimeoutWrapper 43 | def opt 44 | [:hstretch, :notify] 45 | end 46 | end 47 | end 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/bcache_backing_for.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to specify the bcache device which is going to be backed 27 | class BcacheBackingFor < CWM::ComboBox 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("Bcache Device") 36 | end 37 | 38 | # @macro seeAbstractWidget 39 | def opt 40 | [:editable] 41 | end 42 | 43 | def items=(devices) 44 | values = [["", ""]] + devices.map { |i| [i, i] } 45 | change_items(values) 46 | end 47 | end 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/bcache_device.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Determines a bcache device 27 | class BcacheDevice < CWM::InputField 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("Device") 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/btrfs_device.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Determines a Btrfs device 27 | class BtrfsDevice < CWM::InputField 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("Device") 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/btrfs_name.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to specify the Btrfs multi-device filesystem in which the device will be included. 27 | class BtrfsName < CWM::ComboBox 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("Btrfs Name") 36 | end 37 | 38 | # @macro seeAbstractWidget 39 | def opt 40 | [:editable] 41 | end 42 | 43 | def items=(devices) 44 | values = [["", ""]] + devices.map { |i| [i, i] } 45 | change_items(values) 46 | end 47 | end 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/cache_mode.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | require "y2storage" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # Widget to select the bcache cache mode 28 | # 29 | # It's part of the bcache_options attribute for a bcache drive section of an AutoYaST profile. 30 | class CacheMode < CWM::ComboBox 31 | # Constructor 32 | def initialize 33 | textdomain "autoinst" 34 | super() 35 | end 36 | 37 | # @macro seeAbstractWidget 38 | def label 39 | _("Cache Mode") 40 | end 41 | 42 | # @macro seeComboBox 43 | def items 44 | Y2Storage::CacheMode.all.map { |i| [i.to_s, i.to_s] } 45 | end 46 | end 47 | end 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/create.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/boolean_selector" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to specify if a partition or logical volume must be created 27 | class Create < BooleanSelector 28 | # Constructor 29 | def initialize 30 | textdomain "autoinst" 31 | super 32 | end 33 | 34 | # @macro seeAbstractWidget 35 | def label 36 | _("Create") 37 | end 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/create_subvolumes.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/boolean_selector" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to set whether Btrfs subvolumes should be created or not. 27 | class CreateSubvolumes < BooleanSelector 28 | # Constructor 29 | def initialize 30 | textdomain "autoinst" 31 | super 32 | end 33 | 34 | # @macro seeAbstractWidget 35 | def label 36 | _("Create Subvolumes") 37 | end 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/crypt_key.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Allows to provide the encryption key 27 | class CryptKey < CWM::InputField 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("Encryption Key") 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/crypt_method.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "y2storage" 22 | require "cwm/common_widgets" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # Selector widget to set the encryption method to use 28 | class CryptMethod < CWM::ComboBox 29 | # Constructor 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | end 34 | 35 | # @macro seeAbstractWidget 36 | def label 37 | _("Encryption Method") 38 | end 39 | 40 | # @macro seeComboBox 41 | def items 42 | @items ||= [ 43 | [nil, ""], 44 | *Y2Storage::EncryptionMethod.all.map { |e| [e.to_sym, e.to_sym.to_s] } 45 | ] 46 | end 47 | end 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/data_raid_level.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/btrfs_raid_level" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to select the Btrfs data RAID level 27 | # 28 | # It corresponds to the `data_raid_level` element within the `btrfs_options` 29 | # of an AutoYaST profile. 30 | class DataRaidLevel < BtrfsRaidLevel 31 | # Constructor 32 | def initialize 33 | textdomain "autoinst" 34 | super() 35 | end 36 | 37 | # @macro seeAbstractWidget 38 | def label 39 | _("Data RAID Level") 40 | end 41 | end 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/disk_device.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Determines a disk device 27 | # 28 | # It corresponds to the `device` element in the profile. 29 | class DiskDevice < CWM::InputField 30 | # Constructor 31 | def initialize 32 | textdomain "autoinst" 33 | super 34 | end 35 | 36 | # @macro seeAbstractWidget 37 | def label 38 | _("Device") 39 | end 40 | end 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/enable_snapshots.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/boolean_selector" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to enables snapshots on Btrfs file systems mounted at / 27 | class EnableSnapshots < BooleanSelector 28 | # Constructor 29 | def initialize 30 | textdomain "autoinst" 31 | super 32 | end 33 | 34 | # @macro seeAbstractWidget 35 | def label 36 | _("Enable Snapshots for Root Filesystem") 37 | end 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/format.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/boolean_selector" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Determines whether the file system should be formatted or not 27 | # 28 | # It corresponds to the format attribute in a partition section of the profile. 29 | class Format < BooleanSelector 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | end 34 | 35 | # @macro seeAbstractWidget 36 | def label 37 | _("Format") 38 | end 39 | end 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/fstopt.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to specify fstab options 27 | class Fstopt < CWM::InputField 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("Mount Options") 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/init_drive.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to determine if the disk should be initialized 27 | # 28 | # It corresponds to the `initialize` element in the profile. 29 | class InitDrive < CWM::CheckBox 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | self.widget_id = "init_drive" 34 | end 35 | 36 | # @macro seeAbstractWidget 37 | def opt 38 | [:notify] 39 | end 40 | 41 | # @macro seeAbstractWidget 42 | def label 43 | _("Initialize Drive") 44 | end 45 | end 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/keep_unknown_lv.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/boolean_selector" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to set the keep_unknown_lv option for LVM drives 27 | class KeepUnknownLv < BooleanSelector 28 | # Constructor 29 | def initialize 30 | textdomain "autoinst" 31 | super 32 | end 33 | 34 | # @macro seeAbstractWidget 35 | def label 36 | _("Keep Unknown LVs") 37 | end 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/label.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to specify a partition label 27 | class Label < CWM::InputField 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("Label") 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/lv_name.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to determines the LVM LV name 27 | class LvName < CWM::InputField 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("LV Name") 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/lvm_group.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Determines an LVM group name 27 | class LvmGroup < CWM::ComboBox 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("LVM Group") 36 | end 37 | 38 | # @macro seeAbstractWidget 39 | def opt 40 | [:editable] 41 | end 42 | 43 | def items=(devices) 44 | values = [["", ""]] + devices.map { |i| [i, i] } 45 | change_items(values) 46 | end 47 | end 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/metadata_raid_level.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/btrfs_raid_level" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to select the Btrfs metadata RAID level 27 | # 28 | # It corresponds to the `metadata_raid_level` element within the `btrfs_options` 29 | # of an AutoYaST profile. 30 | class MetadataRaidLevel < BtrfsRaidLevel 31 | # Constructor 32 | def initialize 33 | textdomain "autoinst" 34 | super() 35 | end 36 | 37 | # @macro seeAbstractWidget 38 | def label 39 | _("Metadata RAID Level") 40 | end 41 | end 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/mkfs_options.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to specify the mkfs command options 27 | class MkfsOptions < CWM::InputField 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("Mkfs Options") 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/mountby.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "y2storage" 22 | require "cwm/common_widgets" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # Selector widget to set the partition mount type 28 | class Mountby < CWM::ComboBox 29 | # Constructor 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | end 34 | 35 | # @macro seeAbstractWidget 36 | def label 37 | _("Mount By") 38 | end 39 | 40 | # @macro seeComboBox 41 | def items 42 | @items ||= [ 43 | [nil, ""], 44 | *Y2Storage::Filesystems::MountByType.all.map { |i| [i.to_sym, i.to_human_string] } 45 | ] 46 | end 47 | end 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/nfs_name.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Determines the name of an NFS mount 27 | class NfsName < CWM::InputField 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("NFS Share Name") 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/overview_tree.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/tree" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # A tree that is told what its items are. 27 | # We need a tree whose items include Pages that point to the OverviewTreePager. 28 | class OverviewTree < CWM::Tree 29 | # @return [Array] List of tree items 30 | attr_reader :items 31 | 32 | # Constructor 33 | # 34 | # @param items [Array] List of tree items to be included 35 | def initialize(items) 36 | super() 37 | textdomain "autoinst" 38 | @items = items 39 | end 40 | 41 | # @macro seeAbstractWidget 42 | def label 43 | "" 44 | end 45 | end 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/parity_algorithm.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | require "y2storage" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # Widget to select the parity algorithm for a RAID 28 | # 29 | # It corresponds to the `parity_algorithm` element within a `raid_options` section 30 | # of an AutoYaST profile. 31 | class ParityAlgorithm < CWM::ComboBox 32 | # Constructor 33 | def initialize 34 | textdomain "autoinst" 35 | super() 36 | end 37 | 38 | # @macro seeAbstractWidget 39 | def label 40 | _("Parity Algorithm") 41 | end 42 | 43 | # @macro seeComboBox 44 | def items 45 | Y2Storage::MdParity.all.map { |p| [p.to_s, p.to_human_string] } 46 | end 47 | end 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/partition_nr.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "y2storage" 22 | require "cwm/common_widgets" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # Widget to manage the partition number of a partition section 28 | class PartitionNr < CWM::InputField 29 | # Constructor 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | end 34 | 35 | # @macro seeAbstractWidget 36 | def label 37 | _("Partition Number") 38 | end 39 | end 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/partition_type.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "y2storage" 22 | require "cwm/common_widgets" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # Determines the partition id 28 | class PartitionType < CWM::ComboBox 29 | # Constructor 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | end 34 | 35 | # @macro seeAbstractWidget 36 | def label 37 | _("Partition Type") 38 | end 39 | 40 | # @macro seeComboBox 41 | def items 42 | @items ||= [ 43 | ["", ""], 44 | ["primary", "primary"], 45 | ["logical", "logical"] 46 | ] 47 | end 48 | end 49 | end 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/pesize.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "y2storage" 22 | require "autoinstall/widgets/storage/size_selector" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # Widget to manage the LVM VG extent size 28 | class Pesize < SizeSelector 29 | # Constructor 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | end 34 | 35 | # @macro seeAbstractWidget 36 | def label 37 | _("Physical Extent Size") 38 | end 39 | 40 | def sizes 41 | ["1 MiB", "2 MiB", "4 MiB", "8 MiB", "16 MiB", "32 MiB", "64 MiB"] 42 | end 43 | 44 | def include_max? 45 | false 46 | end 47 | 48 | def include_auto? 49 | false 50 | end 51 | end 52 | end 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/pool.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/boolean_selector" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to set if the LVM logical volume should be an LVM thin pool 27 | class Pool < BooleanSelector 28 | # Constructor 29 | def initialize 30 | textdomain "autoinst" 31 | super 32 | end 33 | 34 | # @macro seeAbstractWidget 35 | def label 36 | _("LVM Thin Pool") 37 | end 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/raid_name.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Determines a RAID name 27 | # 28 | # NOTE: perhaps this widget should be an editable combo box 29 | # containing the names of the already defined RAIDs. 30 | class RaidName < CWM::InputField 31 | def initalize 32 | textdomain "autoinst" 33 | super 34 | end 35 | 36 | # @macro seeAbstractWidget 37 | def label 38 | _("RAID Name") 39 | end 40 | end 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/resize.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/boolean_selector" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to specify when a partition should be resized 27 | class Resize < BooleanSelector 28 | # Constructor 29 | def initialize 30 | textdomain "autoinst" 31 | super 32 | end 33 | 34 | # @macro seeAbstractWidget 35 | def label 36 | _("Resize") 37 | end 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/size.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/size_selector" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Widget to specify the partition section size 27 | class Size < SizeSelector 28 | # Constructor 29 | def initialize 30 | textdomain "autoinst" 31 | super 32 | end 33 | 34 | # @macro seeAbstractWidget 35 | def label 36 | _("Size") 37 | end 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/stripes.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "y2storage" 22 | require "cwm/common_widgets" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # Widget to configure LVM striping 28 | class Stripes < CWM::InputField 29 | # Constructor 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | end 34 | 35 | # @macro seeAbstractWidget 36 | def label 37 | _("Stripes") 38 | end 39 | end 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/stripesize.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "y2storage" 22 | require "cwm/common_widgets" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # Widget to specify the granularity of the stripes 28 | class Stripesize < CWM::InputField 29 | # Constructor 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | end 34 | 35 | # @macro seeAbstractWidget 36 | def label 37 | _("Stripe Size (in KB)") 38 | end 39 | end 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/tmpfs_page.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/drive_page" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # This page allows to edit a `drive` section representing tmpfs filesystems 27 | class TmpfsPage < DrivePage 28 | # @macro seeCustomWidget 29 | def contents 30 | Empty() 31 | end 32 | 33 | # @see DrivePage#values 34 | def values 35 | {} 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/used_as_filesystem.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "autoinstall/widgets/storage/used_as" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Special subclass of {UsedAs} with only one option 27 | class UsedAsFilesystem < UsedAs 28 | # Constructor 29 | def initialize 30 | textdomain "autoinst" 31 | super 32 | end 33 | 34 | # @macro seeComboBox 35 | def items 36 | [ 37 | # TRANSLATORS: option for setting to not use the partition 38 | [:none, _("Do Not Use")], 39 | # TRANSLATORS: option for setting the partition to hold a file system 40 | [:filesystem, _("File System")] 41 | ] 42 | end 43 | end 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/used_pool.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "cwm/common_widgets" 22 | 23 | module Y2Autoinstallation 24 | module Widgets 25 | module Storage 26 | # Determines the name of the LVM thin pool that is used as a data store 27 | class UsedPool < CWM::InputField 28 | def initalize 29 | textdomain "autoinst" 30 | super 31 | end 32 | 33 | # @macro seeAbstractWidget 34 | def label 35 | _("Used Pool") 36 | end 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /src/lib/autoinstall/widgets/storage/uuid.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "yast" 21 | require "y2storage" 22 | require "cwm/common_widgets" 23 | 24 | module Y2Autoinstallation 25 | module Widgets 26 | module Storage 27 | # The widget to manage the partition UUID of a partition section 28 | class Uuid < CWM::InputField 29 | # Constructor 30 | def initialize 31 | textdomain "autoinst" 32 | super 33 | end 34 | 35 | # @macro seeAbstractWidget 36 | def label 37 | _("UUID") 38 | end 39 | end 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /src/lib/autoinstall/yard_doc.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | # Work around YARD inability to link across repos/gems: 21 | # (declaring macros here works because YARD sorts by filename size(!)) 22 | 23 | # @!macro [new] seeAbstractWidget 24 | # @see http://www.rubydoc.info/github/yast/yast-yast2/CWM%2FAbstractWidget:${0} 25 | # @!macro [new] seeCustomWidget 26 | # @see http://www.rubydoc.info/github/yast/yast-yast2/CWM%2FCustomWidget:${0} 27 | # @!macro [new] seeDialog 28 | # @see http://www.rubydoc.info/github/yast/yast-yast2/CWM%2FDialog:${0} 29 | # @!macro [new] seeComboBox 30 | # @see http://www.rubydoc.info/github/yast/yast-yast2/CWM%2FComboBox:${0} 31 | -------------------------------------------------------------------------------- /src/scrconf/autoinstall.scr: -------------------------------------------------------------------------------- 1 | /** 2 | * File: autoinstall.scr 3 | * Summary: Agent for reading desktop files 4 | * Author: Michal Svec 5 | * Anas Nashif 6 | * Access: read / write 7 | * 8 | * Example: 9 | * Dir(.yast2.menuentry) 10 | * (["lan", "modem", "isdn", ...]) 11 | ** 12 | * Read(.yast2.menuentry.lan) 13 | * ("3") 14 | * 15 | * $Id$ 16 | */ 17 | .autoyast2.desktop 18 | 19 | `ag_ini( 20 | `IniAgent( [ "/usr/share/applications/YaST2/*.desktop" , "/usr/share/autoinstall/modules/*.desktop" ], 21 | $[ 22 | "options" : [ ], 23 | "comments" : [ "^[ \t]*;.*", ";.*", "\\{[^}]*\\}", "^[ \t]*$", "^#[ \t].*" ], 24 | "sections" : [ 25 | $[ "begin" : [ 26 | "^[ \t]*\\[[ \t]*(.*[^ \t])[ \t]*\\][ \t]*", 27 | "[%s]", 28 | ]], 29 | ], 30 | "params" : [ 31 | $[ "match" : [ 32 | "^[ \t]*([^=]*[^ \t=])[ \t]*=[ \t]*(.*[^ \t]|)[ \t]*$" , 33 | "%s=%s", 34 | ]], 35 | ], 36 | // "rewrite" : [ 37 | // [ "/usr/share/applications/YaST2/(.*)\.desktop", "/usr/share/applications/YaST2/%s.desktop" ], 38 | // ], 39 | ] 40 | ) 41 | ) 42 | -------------------------------------------------------------------------------- /src/scrconf/cfg_autoinstall.scr: -------------------------------------------------------------------------------- 1 | /** 2 | * File: 3 | * cfg_autoinstall.scr 4 | * Summary: 5 | * SCR Agent for reading/writing /etc/sysconfig/autoinstall 6 | * using the sysconfig-agent 7 | * 8 | * $Id$ 9 | * 10 | * Read/Sets the values defined in /etc/sysconfig/autoinstall 11 | * in an easy manner. 12 | */ 13 | .sysconfig.autoinstall 14 | 15 | `ag_ini( 16 | `SysConfigFile("/etc/sysconfig/autoinstall") 17 | ) 18 | -------------------------------------------------------------------------------- /test/fixtures/autoconf.ycp: -------------------------------------------------------------------------------- 1 | $[ 2 | "general" : $[ 3 | "mode" : $[ 4 | "confirm" : false 5 | ] 6 | ] 7 | ] 8 | -------------------------------------------------------------------------------- /test/fixtures/classes/swap/largeswap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | swap 9 | true 10 | swap 11 | 130 12 | 2000mb 13 | 14 | 15 | ext3 16 | primary 17 | 4Gb 18 | / 19 | 20 | 21 | all 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test/fixtures/classes/swap/largeswap_noroot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | swap 9 | true 10 | swap 11 | 130 12 | 2000mb 13 | 14 | 15 | ext3 16 | primary 17 | 1Gb 18 | /supreme 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/fixtures/empty-autoconf.ycp: -------------------------------------------------------------------------------- 1 | $[ 2 | ] 3 | -------------------------------------------------------------------------------- /test/fixtures/instsys/tmp/YaST2/ask-default-value-scripts/ask-value.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yast/yast-autoinstallation/c1443800dc1fb89a5fc33fbf1d046c6da13253cc/test/fixtures/instsys/tmp/YaST2/ask-default-value-scripts/ask-value.sh -------------------------------------------------------------------------------- /test/fixtures/instsys/tmp/YaST2/ask-scripts/ask.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yast/yast-autoinstallation/c1443800dc1fb89a5fc33fbf1d046c6da13253cc/test/fixtures/instsys/tmp/YaST2/ask-scripts/ask.sh -------------------------------------------------------------------------------- /test/fixtures/instsys/tmp/YaST2/ask-scripts/logs/ask.sh.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yast/yast-autoinstallation/c1443800dc1fb89a5fc33fbf1d046c6da13253cc/test/fixtures/instsys/tmp/YaST2/ask-scripts/logs/ask.sh.log -------------------------------------------------------------------------------- /test/fixtures/instsys/tmp/YaST2/pre-scripts/logs/pre.sh.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yast/yast-autoinstallation/c1443800dc1fb89a5fc33fbf1d046c6da13253cc/test/fixtures/instsys/tmp/YaST2/pre-scripts/logs/pre.sh.log -------------------------------------------------------------------------------- /test/fixtures/instsys/tmp/YaST2/pre-scripts/pre.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yast/yast-autoinstallation/c1443800dc1fb89a5fc33fbf1d046c6da13253cc/test/fixtures/instsys/tmp/YaST2/pre-scripts/pre.sh -------------------------------------------------------------------------------- /test/fixtures/instsys/tmp/profile/autoinst.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yast/yast-autoinstallation/c1443800dc1fb89a5fc33fbf1d046c6da13253cc/test/fixtures/instsys/tmp/profile/autoinst.xml -------------------------------------------------------------------------------- /test/fixtures/network/wicked.out: -------------------------------------------------------------------------------- 1 | lo up 2 | link: #1, state up 3 | type: loopback 4 | control: persistent 5 | config: compat:suse:/etc/sysconfig/network/ifcfg-lo, 6 | uuid: 1040df49-3c8f-515e-abe4-0aa3134b1a21 7 | leases: ipv4 static granted 8 | leases: ipv6 static granted 9 | addr: ipv4 127.0.0.1/8 [static] 10 | addr: ipv6 ::1/128 [static] 11 | route: ipv6 ::1/128 dev #0 type local table main scope universe protocol kernel priority 256 12 | 13 | em1 up 14 | link: #2, state up, mtu 1500 15 | type: ethernet, hwaddr 99:99:99:99:99:99 16 | control: none 17 | config: compat:suse:/etc/sysconfig/network/ifcfg-em1, 18 | uuid: 2c1933h4-e982-50f4-96ae-929556183dd3 19 | leases: ipv4 dhcp granted [group] 20 | leases: ipv6 dhcp requesting [group] 21 | addr: ipv6 fe80::9a90:96ff:fed1:f2b2/64 22 | addr: ipv4 10.163.2.8/28 [dhcp] 23 | route: ipv4 0.0.0.0/0 via 10.163.2.1 dev #0 type unicast table main scope universe protocol dhcp 24 | route: ipv4 10.163.2.0/28 dev #0 type unicast table main scope link protocol kernel pref-src 10.163.2.8 25 | route: ipv6 fe80::/64 dev #0 type unicast table main scope universe protocol kernel priority 256 26 | -------------------------------------------------------------------------------- /test/fixtures/network/wicked_partial.out: -------------------------------------------------------------------------------- 1 | route: ipv4 192.168.100.0/24 dev #0 type unicast table main scope link protocol kernel pref-src 192.168.100.218 2 | -------------------------------------------------------------------------------- /test/fixtures/output/ip_route.out: -------------------------------------------------------------------------------- 1 | default via 10.13.32.1 dev eth0 proto dhcp 2 | 10.13.32.0/24 dev eth0 proto kernel scope link src 10.13.32.195 metric 600 3 | 10.163.0.1 dev tun0 proto kernel scope link src 10.163.0.6 4 | 10.163.2.0/28 dev eth1 proto kernel scope link src 10.163.2.1 -------------------------------------------------------------------------------- /test/fixtures/output/wicked_output: -------------------------------------------------------------------------------- 1 | route: ipv4 192.168.100.0/24 dev #0 type unicast table main scope link protocol kernel pref-src 192.168.100.218 2 | -------------------------------------------------------------------------------- /test/fixtures/profiles/invalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/fixtures/profiles/leap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | openSUSE 7 | 8 | true 9 | 10 | base 11 | enhanced_base 12 | 13 | 14 | chrony> 15 | 16 | 17 | 18 | 19 | en_US 20 | en_US 21 | 22 | 23 | 24 | 25 | false 26 | root 27 | 0 28 | /root 29 | /bin/bash 30 | 0 31 | nots3cr3t 32 | root 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /test/fixtures/profiles/minimal.xml.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP MESSAGE----- 2 | 3 | jA0EBwMC3pVu9bV/fs7u0sDfAVP9uQYu878YhSbdllHtB3N9qf2peEdurg/u2ZMe 4 | 0Ns33iur6spH6WSapExX6I9pDw+ms07dwGWe55XF9crjbdfY1wKbP4+tVoQbrmAG 5 | qmr6QWfKsYdxQ5d2YPn82phEPdwppXxSVHauIEr4+7eAHzsGUhZD4HV5DUiCr7UO 6 | mAJcBKiP4Z8z/k6fOJ2FeIc5dUFzaZzc2FcY6TvyxFwAD0pd/EfHRGgb/YVZYuIR 7 | wP/XS1NIt/q67G16k3BogdTT3dR5iNVekcHaou8TXw2X/Hd9F/TVlPXNUekuqc44 8 | lqd2CpQNRGwQy7b37vxL/asWBrPYM+k0JdI/oprCAJLRgYCAoM2KjCHB+80CZ8bt 9 | q8u0YjsEwEX2QQBw2E40H4LO/6JehTvRe2DAv5FzzuKUTUD3HsV1WgisA4XOZsO4 10 | OkbhaMNefnMFPZB8mJvdtCWKjpwIGAaJWS+xio6/kIzjXAQSeJH8C1+5izTTgtuc 11 | 3S3iJ2NkyrGhEDxqeDfuJf5Vxz0YPRe/viZSkLQN2fvRR31uK0s34/yE150kbkB2 12 | ew== 13 | =0XLd 14 | -----END PGP MESSAGE----- 15 | -------------------------------------------------------------------------------- /test/fixtures/profiles/software.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | a1 9 | a2 10 | a3 11 | 12 | 13 | a1 14 | a2 15 | a3 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/lib/autoinstall/ask/dialog_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/ask/question" 22 | require "autoinstall/ask/dialog" 23 | 24 | describe Y2Autoinstall::Ask::Dialog do 25 | describe "#update" do 26 | describe ".new" do 27 | let(:question1) do 28 | Y2Autoinstall::Ask::Question.new("Question 1") 29 | end 30 | 31 | it "returns a dialog with the given id and the list of questions" do 32 | dialog = described_class.new(1, [question1]) 33 | expect(dialog.id).to eq(1) 34 | expect(dialog.questions).to eq([question1]) 35 | end 36 | end 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /test/lib/autoinstall/ask/script_section_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/autoinst_profile/script_section" 22 | 23 | describe Y2Autoinstall::AutoinstProfile::ScriptSection do 24 | describe ".new_from_hashes" do 25 | let(:hash) do 26 | { "filename" => "script.sh", 27 | "environment" => true } 28 | end 29 | 30 | it "returns an ScriptSection with the given attributes" do 31 | section = described_class.new_from_hashes(hash) 32 | 33 | expect(section.filename).to eq("script.sh") 34 | expect(section.environment).to eq(true) 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/lib/autoinstall/ask/stage_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/ask/stage" 22 | 23 | describe Y2Autoinstall::Ask::Stage do 24 | describe "#from_name" do 25 | it "returns the stage with the given name" do 26 | expect(described_class.from_name("initial")) 27 | .to eq(Y2Autoinstall::Ask::Stage::INITIAL) 28 | end 29 | 30 | context "when the stage is not known" do 31 | it "returns nil" do 32 | expect(described_class.from_name("foo")).to eq(nil) 33 | end 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /test/lib/autoinstall/autoinst_profile/ask_list_section_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/autoinst_profile/ask_list_section" 22 | 23 | describe Y2Autoinstall::AutoinstProfile::AskListSection do 24 | describe ".new_from_hashes" do 25 | it "returns an instance containing the entries" do 26 | section = described_class.new_from_hashes( 27 | [{ "question" => "Question 1" }, { "question" => "Question 2" }] 28 | ) 29 | 30 | expect(section.entries.map(&:question)).to eq(["Question 1", "Question 2"]) 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /test/lib/autoinstall/autoinst_profile/ask_selection_entry_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/autoinst_profile/ask_section" 22 | require "autoinstall/autoinst_profile/ask_selection_entry" 23 | 24 | describe Y2Autoinstall::AutoinstProfile::AskSelectionEntry do 25 | describe ".new_from_hashes" do 26 | let(:hash) do 27 | { 28 | "value" => "opt1", 29 | "label" => "Option 1" 30 | } 31 | end 32 | 33 | it "returns an AskSection with the given attributes" do 34 | section = described_class.new_from_hashes(hash) 35 | 36 | expect(section.value).to eq("opt1") 37 | expect(section.label).to eq("Option 1") 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /test/lib/autoinstall/widgets/ask/input_field_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2021] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../../test_helper" 21 | require "autoinstall/widgets/ask/input_field" 22 | require "autoinstall/ask/question" 23 | require "cwm/rspec" 24 | 25 | describe Y2Autoinstall::Widgets::Ask::InputField do 26 | subject { described_class.new(question) } 27 | 28 | let(:question) do 29 | Y2Autoinstall::Ask::Question.new("Question 1") 30 | end 31 | 32 | include_examples "CWM::InputField" 33 | include_examples "ask dialog widget" 34 | include_examples "ask dialog widget initialization" 35 | end 36 | -------------------------------------------------------------------------------- /test/lib/clients/autoinst_files_finish_test.rb: -------------------------------------------------------------------------------- 1 | require_relative "../../test_helper" 2 | require "autoinstall/clients/autoinst_files_finish" 3 | 4 | describe Y2Autoinstallation::Clients::AutoinstFilesFinish do 5 | describe "#write" do 6 | 7 | it "writes additional configuration files" do 8 | expect(Yast::AutoinstFile).to receive(:Write) 9 | subject.write 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/lib/dialogs/storage_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../test_helper" 21 | require "autoinstall/dialogs/storage" 22 | require "y2storage" 23 | require "cwm/rspec" 24 | 25 | describe Y2Autoinstallation::Dialogs::Storage do 26 | subject { described_class.new(partitioning) } 27 | let(:partitioning) { Y2Storage::AutoinstProfile::PartitioningSection.new_from_hashes([]) } 28 | 29 | include_examples "CWM::Dialog" 30 | end 31 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/add_children_button_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/add_partition_button" 22 | require "autoinstall/storage_controller" 23 | require "cwm/rspec" 24 | 25 | describe Y2Autoinstallation::Widgets::Storage::AddPartitionButton do 26 | subject(:widget) { described_class.new(controller) } 27 | 28 | include_examples "CWM::PushButton" 29 | 30 | let(:controller) { Y2Autoinstallation::StorageController.new(partitioning) } 31 | let(:partitioning) do 32 | Y2Storage::AutoinstProfile::PartitioningSection.new_from_hashes( 33 | [{ type: :CT_DISK, device: "/dev/sda" }] 34 | ) 35 | end 36 | 37 | describe "#handle" do 38 | it "adds new partition section" do 39 | expect(controller).to receive(:add_partition) 40 | widget.handle 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/bcache_backing_for_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/bcache_backing_for" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::BcacheBackingFor do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | 29 | describe "#items=" do 30 | let(:devices) { ["/dev/bcache0", "/dev/bcache1"] } 31 | 32 | it "updates the widget with given devices including an empty option" do 33 | expect(widget).to receive(:change_items).with( 34 | [ 35 | ["", ""], 36 | ["/dev/bcache0", "/dev/bcache0"], 37 | ["/dev/bcache1", "/dev/bcache1"] 38 | ] 39 | ) 40 | 41 | widget.items = devices 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/bcache_device_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/bcache_device" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::BcacheDevice do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/boolean_selector_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/boolean_selector" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::BooleanSelector do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BooleanSelector" 28 | 29 | describe "#include_blank?" do 30 | it "returns true" do 31 | expect(subject.include_blank?).to eq(true) 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/btrfs_device_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/btrfs_device" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::BtrfsDevice do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/btrfs_name_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/btrfs_name" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::BtrfsName do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | 29 | describe "#items=" do 30 | let(:devices) { ["rootfs", "homefs"] } 31 | 32 | it "updates the widget with given filesystems including an empty option" do 33 | expect(widget).to receive(:change_items).with( 34 | [ 35 | ["", ""], 36 | ["rootfs", "rootfs"], 37 | ["homefs", "homefs"] 38 | ] 39 | ) 40 | 41 | widget.items = devices 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/btrfs_raid_level_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/btrfs_raid_level" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::BtrfsRaidLevel do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BtrfsRaidLevel" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/cache_mode_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/cache_mode" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::CacheMode do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::AbstractWidget" 28 | 29 | describe "#items" do 30 | let(:items) { widget.items.map { |i| i[0] } } 31 | 32 | it "includes 'none'" do 33 | expect(items).to include("none") 34 | end 35 | 36 | it "includes 'writethrough'" do 37 | expect(items).to include("writethrough") 38 | end 39 | 40 | it "includes 'writeback'" do 41 | expect(items).to include("writeback") 42 | end 43 | 44 | it "includes 'writearound'" do 45 | expect(items).to include("writearound") 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/chunk_size_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/chunk_size" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::ChunkSize do 25 | subject { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/create_subvolumes_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/create_subvolumes" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::CreateSubvolumes do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BooleanSelector" 28 | 29 | describe "#include_blank?" do 30 | it "returns true" do 31 | expect(subject.include_blank?).to eq(true) 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/create_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/create" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Create do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BooleanSelector" 28 | 29 | describe "#include_blank?" do 30 | it "returns true" do 31 | expect(subject.include_blank?).to eq(true) 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/crypt_key_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/crypt_key" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::CryptKey do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/data_raid_level_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/data_raid_level" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::DataRaidLevel do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BtrfsRaidLevel" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/delete_section_button_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/delete_section_button" 22 | require "autoinstall/storage_controller" 23 | require "cwm/rspec" 24 | 25 | describe Y2Autoinstallation::Widgets::Storage::DeleteSectionButton do 26 | subject { described_class.new(controller) } 27 | 28 | let(:controller) { Y2Autoinstallation::StorageController.new(partitioning) } 29 | let(:partitioning) do 30 | Y2Storage::AutoinstProfile::PartitioningSection.new_from_hashes([]) 31 | end 32 | 33 | include_examples "CWM::PushButton" 34 | end 35 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/disk_device_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/disk_device" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::DiskDevice do 25 | subject { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/disk_usage_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/disk_usage" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::DiskUsage do 25 | subject { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/disklabel_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/disklabel" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Disklabel do 25 | subject(:disklabel_widget) { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | 29 | describe "#items" do 30 | let(:items) { disklabel_widget.items.map { |i| i[0] } } 31 | 32 | it "includes 'none'" do 33 | expect(items).to include("none") 34 | end 35 | 36 | it "includes 'msdos'" do 37 | expect(items).to include("msdos") 38 | end 39 | 40 | it "includes 'gpt'" do 41 | expect(items).to include("gpt") 42 | end 43 | 44 | it "includes 'dasd'" do 45 | expect(items).to include("dasd") 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/enable_snapshots_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/enable_snapshots" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::EnableSnapshots do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BooleanSelector" 28 | 29 | describe "#include_blank?" do 30 | it "returns true" do 31 | expect(subject.include_blank?).to eq(true) 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/format_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/format" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Format do 25 | subject { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BooleanSelector" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/fstopt_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/fstopt" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Fstopt do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/keep_unknown_lv_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/keep_unknown_lv" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::KeepUnknownLv do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BooleanSelector" 28 | 29 | describe "#include_blank?" do 30 | it "returns true" do 31 | expect(subject.include_blank?).to eq(true) 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/label_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/label" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Label do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/lvm_group_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/lvm_group" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::LvmGroup do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | 29 | describe "#items=" do 30 | let(:devices) { ["vg-system", "vg-home"] } 31 | 32 | it "updates the widget with given devices including an empty option" do 33 | expect(widget).to receive(:change_items).with( 34 | [ 35 | ["", ""], 36 | ["vg-system", "vg-system"], 37 | ["vg-home", "vg-home"] 38 | ] 39 | ) 40 | 41 | widget.items = devices 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/md_level_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/md_level" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::MdLevel do 25 | subject { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/metadata_raid_level_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/metadata_raid_level" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::MetadataRaidLevel do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BtrfsRaidLevel" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/mkfs_options_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/mkfs_options" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::MkfsOptions do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/mount_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/mount" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Mount do 25 | subject { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/parity_algorithm_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/parity_algorithm" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::ParityAlgorithm do 25 | subject { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/partition_nr_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/partition_nr" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::PartitionNr do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/partition_tab_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/partition_tab" 23 | require "autoinstall/presenters" 24 | require "y2storage/autoinst_profile" 25 | 26 | describe Y2Autoinstallation::Widgets::Storage::PartitionTab do 27 | subject { described_class.new(partition) } 28 | 29 | let(:partitioning) do 30 | Y2Storage::AutoinstProfile::PartitioningSection.new_from_hashes( 31 | [{ "type" => :CT_DISK, "partitions" => [{ "create" => true }] }] 32 | ) 33 | end 34 | let(:drive) { Y2Autoinstallation::Presenters::Drive.new(partitioning.drives.first) } 35 | let(:partition) { drive.partitions.first } 36 | 37 | include_examples "Y2Autoinstallation::Widgets::Storage::PartitionTab" 38 | end 39 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/partition_type_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/partition_type" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::PartitionType do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::ComboBox" 28 | 29 | describe "#items" do 30 | let(:items) { widget.items.map { |i| i[0] } } 31 | 32 | it "includes an empty item" do 33 | expect(items).to include("") 34 | end 35 | 36 | it "includes 'primary'" do 37 | expect(items).to include("primary") 38 | end 39 | 40 | it "includes 'logical'" do 41 | expect(items).to include("primary") 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/pesize_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/pesize" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Pesize do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::SizeSelector" 28 | 29 | describe "#include_blank?" do 30 | it "returns true" do 31 | expect(subject.include_blank?).to eq(true) 32 | end 33 | end 34 | 35 | describe "#include_auto?" do 36 | it "returns false" do 37 | expect(subject.include_auto?).to eq(false) 38 | end 39 | end 40 | 41 | describe "#include_max?" do 42 | it "returns false" do 43 | expect(subject.include_max?).to eq(false) 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/pool_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/pool" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Pool do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BooleanSelector" 28 | 29 | describe "#include_blank?" do 30 | it "returns true" do 31 | expect(subject.include_blank?).to eq(true) 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/resize_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/resize" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Resize do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::BooleanSelector" 28 | 29 | describe "#include_blank?" do 30 | it "returns true" do 31 | expect(subject.include_blank?).to eq(true) 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/size_selector_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/size_selector" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::SizeSelector do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::SizeSelector" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/size_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require_relative "./shared_examples" 22 | require "autoinstall/widgets/storage/size" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Size do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "Y2Autoinstallation::Widgets::Storage::SizeSelector" 28 | 29 | describe "#include_blank?" do 30 | it "returns true" do 31 | expect(subject.include_blank?).to eq(true) 32 | end 33 | end 34 | 35 | describe "#include_auto?" do 36 | it "returns true" do 37 | expect(subject.include_auto?).to eq(true) 38 | end 39 | end 40 | 41 | describe "#include_max?" do 42 | it "returns true" do 43 | expect(subject.include_max?).to eq(true) 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/stripes_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/stripes" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Stripes do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/stripesize_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/stripesize" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Stripesize do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/used_pool_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/used_pool" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::UsedPool do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/lib/widgets/storage/uuid_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require_relative "../../../test_helper" 21 | require "autoinstall/widgets/storage/uuid" 22 | require "cwm/rspec" 23 | 24 | describe Y2Autoinstallation::Widgets::Storage::Uuid do 25 | subject(:widget) { described_class.new } 26 | 27 | include_examples "CWM::InputField" 28 | end 29 | -------------------------------------------------------------------------------- /test/support/storage_helpers.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) [2020] SUSE LLC 2 | # 3 | # All Rights Reserved. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of version 2 of the GNU General Public License as published 7 | # by the Free Software Foundation. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 | # more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, contact SUSE LLC. 16 | # 17 | # To contact SUSE LLC about this file by physical or electronic mail, you may 18 | # find current contact information at www.suse.com. 19 | 20 | require "y2storage" 21 | 22 | module Y2Autoinstall 23 | module RSpec 24 | # Storage helpers to be used in tests 25 | # 26 | # @note In the future, we should use the helpers in the yast2-storage module. 27 | # @see https://github.com/yast/yast-storage-ng/blob/9ffcc243001efcc356f81b1b7f1e351f37c1c724/test/support/storage_helpers.rb 28 | # NOTE: we should move the ones inclu 29 | module StorageHelpers 30 | def fake_storage_scenario(scenario) 31 | Y2Storage::StorageManager.create_test_instance 32 | 33 | meth = scenario.end_with?(".xml") ? :probe_from_xml : :probe_from_yaml 34 | Y2Storage::StorageManager.instance.public_send(meth, input_file_for(scenario)) 35 | end 36 | 37 | def input_file_for(name, suffix: "yml") 38 | path = File.join(FIXTURES_PATH, "storage", name) 39 | path << ".#{suffix}" if File.extname(path).empty? 40 | path 41 | end 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /test_xml/README.md: -------------------------------------------------------------------------------- 1 | These are xml files for testing various aspects of autoyast. 2 | They are still also hosted on taylor.suse.de for testing. 3 | taylor.suse.de has an apache runing and these files are in 4 | directory /srv/www/htdocs on taylor. 5 | -------------------------------------------------------------------------------- /test_xml/blog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 0 8 | static_text 9 | 10 | 11 | 12 | 13 | 1 14 | static_text 15 | 20 | 21 | 22 | 23 | 1 24 | to eat? 25 | 30 26 | back to the drinks 27 | order now! 28 | 29 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /test_xml/choose.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | part1.xml 10 | 11 | 12 | 13 | part2.xml 14 | 15 | 16 | 17 | part3.xml 18 | 19 | 20 | 21 | classes.xml 22 | 23 | 24 | 25 | XML Profile 26 | Choose a profile 27 | initial 28 | part1.xml 29 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /test_xml/classes/eth0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | eth0 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test_xml/classes/largeswap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | swap 8 | largeswap.xml 9 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test_xml/classes/swap/largeswap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | swap 9 | true 10 | swap 11 | 130 12 | 2000mb 13 | 14 | 15 | ext3 16 | primary 17 | 4Gb 18 | / 19 | 20 | 21 | all 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test_xml/classes/swap/largeswap_noroot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | swap 9 | true 10 | swap 11 | 130 12 | 2000mb 13 | 14 | 15 | ext3 16 | primary 17 | 1Gb 18 | /supreme 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test_xml/classes/vmware.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | tda-vmware-tools 20 | emil-vmware-tools 21 | emil2-vmware-tools 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test_xml/deprecated_bootloader.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | grub 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test_xml/dynamic.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | openSUSE 5 | 6 | 7 | <%# first lets create list of disk names according to its size %> 8 | <% sorted_disks = disks.sort_by { |d| d[:size] }.map { |d| d[:device] }.reverse %> 9 | 10 | <% sorted_disks[0..1].each do |name| %> 11 | 12 | 13 | <%= name %> 14 | 15 | 16 | true 17 | 18 | 19 | <% end %> 20 | 21 | <%# situation: machine has two network catds. One leads to intranet and other to internet, so here we create udev 22 | rules to have internet one as eth0 and intranet as eth1. To distinguish in this example if use active flag for intranet %> 23 | 24 | 25 | 26 | eth0 27 | ATTR{address} 28 | 29 | <%= network_cards.find { |c| c[:link] }[:mac] %> 30 | 31 | 32 | 33 | eth1 34 | ATTR{address} 35 | 36 | <%= network_cards.find { |c| !c[:link] }[:mac] %> 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /test_xml/dynamic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /test_xml/fix.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 19 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /test_xml/jo.xml: -------------------------------------------------------------------------------- 1 | 2 | 24 3 | Cornelius' JeOS 4 | 2009-04-24 12:09:42 UTC 5 | http://susestudio.com/appliance/edit/24 6 | http://susestudio.com/api/v1/user/appliance_icon/1234 7 | 11.1 8 | 9 | 1 10 | openSUSE 11.1, Just enough OS (JeOS) 11 | 12 | 13 | 14 | 28 15 | 0.0.1 16 | oem 17 | 238 18 | 87 19 | http://susestudio.com/download/bf1a0f08884ebac13f30b0fc62dfc44a/Cornelius_JeOS.x86_64-0.0.1.oem.tar.gz 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test_xml/min.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | false 7 | myrootpassword 8 | root 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test_xml/rules/classes/eth0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | eth0 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test_xml/rules/classes/vmware.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | tda-vmware-tools 7 | emil-vmware-tools 8 | emil2-vmware-tools 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test_xml/rules/kde.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | kde 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test_xml/rules/minimal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Minimal 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test_xml/rules/rules.xml.test: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 100 13 | exact 14 | 15 | 16 | rules/kde.xml 17 | true 18 | 19 | 20 | 0 21 | KDE Desktop 22 | Desktop Selection 23 | 24 | 1 25 | 26 | 0 27 | 30 28 | 29 | 30 | 31 | 32 | 37 | 101 38 | exact 39 | 40 | 41 | rules/gnome.xml 42 | true 43 | 44 | 45 | 1 46 | 0 47 | Gnome Desktop 48 | 49 | 0 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /test_xml/scripts/chroot_script_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "chroot script $0 (chroot false) has run" > /tmp/chroot-script-has-run 4 | sleep 3 #000 5 | -------------------------------------------------------------------------------- /test_xml/scripts/chroot_script_test2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "chroot script $0 (chroot true) has run" > /tmp/chroot-script-has-run 4 | sleep 10 5 | echo $* >> /tmp/chroot-script-has-run 6 | echo ARG0:$0: >> /tmp/chroot-script-has-run 7 | echo ARG1:$1: >> /tmp/chroot-script-has-run 8 | echo ARG2:$2: >> /tmp/chroot-script-has-run 9 | echo ARG3:$3: >> /tmp/chroot-script-has-run 10 | echo ARG4:$4: >> /tmp/chroot-script-has-run 11 | echo ARG5:$5: >> /tmp/chroot-script-has-run 12 | echo ARG6:$6: >> /tmp/chroot-script-has-run 13 | echo ARG7:$7: >> /tmp/chroot-script-has-run 14 | echo ARG8:$8: >> /tmp/chroot-script-has-run 15 | echo ARG9:$9: >> /tmp/chroot-script-has-run 16 | 17 | -------------------------------------------------------------------------------- /test_xml/scripts/file_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Testing file scripts with location" >> /etc/someconf.conf 4 | df >> /etc/someconf.conf 5 | cd /root 6 | ls >> /etc/someconf.conf 7 | -------------------------------------------------------------------------------- /test_xml/scripts/init_script_test2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "init script2 has run" > /tmp/init-script2-has-run 4 | 5 | -------------------------------------------------------------------------------- /test_xml/scripts/post_script_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "post script (network false) has run" > /tmp/post-script-has-run 4 | echo $* >> /tmp/post-script-has-run 5 | echo ARG0:$0: >> /tmp/post-script-has-run 6 | echo ARG1:$1: >> /tmp/post-script-has-run 7 | echo ARG2:$2: >> /tmp/post-script-has-run 8 | echo ARG3:$3: >> /tmp/post-script-has-run 9 | echo ARG4:$4: >> /tmp/post-script-has-run 10 | echo ARG5:$5: >> /tmp/post-script-has-run 11 | echo ARG6:$6: >> /tmp/post-script-has-run 12 | echo ARG7:$7: >> /tmp/post-script-has-run 13 | echo ARG8:$8: >> /tmp/post-script-has-run 14 | echo ARG9:$9: >> /tmp/post-script-has-run 15 | 16 | -------------------------------------------------------------------------------- /test_xml/scripts/post_script_test2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "post script (network true) has run" > /tmp/post-script2-has-run 4 | 5 | -------------------------------------------------------------------------------- /test_xml/scripts/postpart_script_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "postpart script has run" > /tmp/postpart-script-has-run 4 | echo $* >> /tmp/postpart-script-has-run 5 | echo ARG0:$0: >> /tmp/postpart-script-has-run 6 | echo ARG1:$1: >> /tmp/postpart-script-has-run 7 | echo ARG2:$2: >> /tmp/postpart-script-has-run 8 | echo ARG3:$3: >> /tmp/postpart-script-has-run 9 | echo ARG4:$4: >> /tmp/postpart-script-has-run 10 | echo ARG5:$5: >> /tmp/postpart-script-has-run 11 | echo ARG6:$6: >> /tmp/postpart-script-has-run 12 | echo ARG7:$7: >> /tmp/postpart-script-has-run 13 | echo ARG8:$8: >> /tmp/postpart-script-has-run 14 | echo ARG9:$9: >> /tmp/postpart-script-has-run 15 | 16 | 17 | -------------------------------------------------------------------------------- /test_xml/scripts/pre_script_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "pre script has run" > /tmp/pre-script-has-run 4 | echo $* >> /tmp/pre-script-has-run 5 | echo ARG0:$0: >> /tmp/pre-script-has-run 6 | echo ARG1:$1: >> /tmp/pre-script-has-run 7 | echo ARG2:$2: >> /tmp/pre-script-has-run 8 | echo ARG3:$3: >> /tmp/pre-script-has-run 9 | echo ARG4:$4: >> /tmp/pre-script-has-run 10 | echo ARG5:$5: >> /tmp/pre-script-has-run 11 | echo ARG6:$6: >> /tmp/pre-script-has-run 12 | echo ARG7:$7: >> /tmp/pre-script-has-run 13 | echo ARG8:$8: >> /tmp/pre-script-has-run 14 | echo ARG9:$9: >> /tmp/pre-script-has-run 15 | 16 | -------------------------------------------------------------------------------- /test_xml/simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | false 7 | 8 | 9 | 10 | true 11 | 12 | 13 | true 14 | 15 | base 16 | 17 | 18 | 19 | 20 | false 21 | root 22 | 0 23 | /root 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | /bin/bash 33 | 0 34 | s3cr3t 35 | root 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /test_xml/sysconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MAX_RPMDB_BACKUPS 7 | /etc/sysconfig/backup 8 | 15 9 | 10 | 11 | NFS4_SUPPORT 12 | /etc/sysconfig/nfs 13 | no 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test_xml/testing.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | true 9 | 10 | 11 | 12 | /tmp/uwe_bla 13 | uwe:users 14 | 444 15 | 16 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /test_xml/ui-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | false 7 | 8 | 9 | 10 | true 11 | 12 | 13 | true 14 | 15 | base 16 | 17 | 18 | 19 | 20 | false 21 | root 22 | 0 23 | /root 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | /bin/bash 33 | 0 34 | s3cr3t 35 | root 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /test_xml/xinclude_incl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Kde 6 | 7 | Minimal 8 | 9 | apache 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /xslt/new_types.xslt: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /xslt/old_types.xslt: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /xslt/rng/convert: -------------------------------------------------------------------------------- 1 | #! /bin/sh -x 2 | # take the current dtd and convert it to rnc (or rny) 3 | # before handing off to individual maintainers 4 | 5 | TRANG=trang 6 | #TRANG=trangj 7 | 8 | $TRANG -i inline-attlist -i xmlns=http://www.suse.com/1.0/yast2ns -i xmlns:config=http://www.suse.com/1.0/configns ../dtd/profile.dtd profile.rnc 9 | perl -i.pre simplify-types *.rnc 10 | -------------------------------------------------------------------------------- /xslt/rng/runlevels.rnc: -------------------------------------------------------------------------------- 1 | default namespace = "http://www.suse.com/1.0/yast2ns" 2 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 3 | namespace config = "http://www.suse.com/1.0/configns" 4 | 5 | runlevel = element runlevel { \default?, services? } 6 | service = 7 | element service { 8 | service_name? & 9 | service_status? & 10 | service_start? & 11 | service_stop 12 | } 13 | service_name = element service_name { text } 14 | service_status = element service_status { "enable" | "disable" } 15 | service_start = element service_start { text } 16 | service_stop = element service_stop { text } 17 | services = 18 | element services { 19 | LIST, 20 | service+ 21 | } 22 | -------------------------------------------------------------------------------- /xslt/rng/simplify-types: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -p 2 | # part of converting DTD to RNC 3 | BEGIN {undef $/;} 4 | 5 | s/ *\[ a:defaultValue = "(boolean|integer|symbol|list)" \]\n//g; 6 | s/attribute config:type { string "(boolean|integer|symbol|list)" }\?/\U$1\E/g; 7 | s/{\s+(BOOLEAN|INTEGER|SYMBOL),\s+text\s+}/{ $1 }/gs; 8 | -------------------------------------------------------------------------------- /xslt/rng/sound.rnc: -------------------------------------------------------------------------------- 1 | default namespace = "http://www.suse.com/1.0/yast2ns" 2 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 3 | namespace config = "http://www.suse.com/1.0/configns" 4 | 5 | LOAD_ALSA_SEQ = element LOAD_ALSA_SEQ { text } 6 | module_conf = 7 | element module_conf { snd_alias? & model? & snd_module? & snd_options? & unique_key? } 8 | modules_conf = 9 | element modules_conf { 10 | module_conf* 11 | } 12 | new = 13 | element new { 14 | text 15 | } 16 | snd_options = element options { 17 | Anything* 18 | } 19 | 20 | rc_vars = element rc_vars { LOAD_ALSA_SEQ* } 21 | snd_enable = element snd_enable { text } 22 | snd_index = element snd_index { text } 23 | sound = 24 | element sound { 25 | configure_detected? & modules_conf? & rc_vars? & volume_settings? 26 | } 27 | state = element state { text } 28 | unique_key = element unique_key { text } 29 | unknown-state = element unknown-state { text } 30 | volume_component_settings = 31 | element volume_component_settings { 32 | attribute config:type { text }?, 33 | text 34 | } 35 | volume_entry = 36 | element volume_entry { 37 | Anything* 38 | } 39 | volume_settings = 40 | element volume_settings { 41 | volume_entry* 42 | } 43 | configure_detected = 44 | element configure_detected { BOOLEAN } 45 | ac97_clock = element ac97_clock { text } 46 | ac97_quirk = element ac97_quirk { text } 47 | enable = element enable { text } 48 | index = element index { text } 49 | isapnp = element isapnp { text } 50 | joystick = element joystick { text } 51 | snd_module = element module { text } 52 | snd_alias = element alias { text } 53 | --------------------------------------------------------------------------------