kanrisuru 0.12.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -1
- data/README.md +5 -5
- data/lib/kanrisuru/command.rb +10 -0
- data/lib/kanrisuru/core/apt/commands/autoclean.rb +13 -0
- data/lib/kanrisuru/core/apt/commands/autoremove.rb +15 -0
- data/lib/kanrisuru/core/apt/commands/clean.rb +13 -0
- data/lib/kanrisuru/core/apt/commands/full_upgrade.rb +14 -0
- data/lib/kanrisuru/core/apt/commands/install.rb +22 -0
- data/lib/kanrisuru/core/apt/commands/list.rb +21 -0
- data/lib/kanrisuru/core/apt/commands/purge.rb +18 -0
- data/lib/kanrisuru/core/apt/commands/remove.rb +18 -0
- data/lib/kanrisuru/core/apt/commands/search.rb +18 -0
- data/lib/kanrisuru/core/apt/commands/show.rb +21 -0
- data/lib/kanrisuru/core/apt/commands/update.rb +14 -0
- data/lib/kanrisuru/core/apt/commands/upgrade.rb +14 -0
- data/lib/kanrisuru/core/apt/commands.rb +14 -0
- data/lib/kanrisuru/core/apt/parser.rb +6 -0
- data/lib/kanrisuru/core/apt/parsers/base.rb +51 -0
- data/lib/kanrisuru/core/apt/parsers/list.rb +28 -0
- data/lib/kanrisuru/core/apt/parsers/search.rb +32 -0
- data/lib/kanrisuru/core/apt/parsers/show.rb +90 -0
- data/lib/kanrisuru/core/apt/types.rb +36 -0
- data/lib/kanrisuru/core/apt.rb +4 -284
- data/lib/kanrisuru/core/archive/commands/tar.rb +126 -0
- data/lib/kanrisuru/core/archive/commands.rb +3 -0
- data/lib/kanrisuru/core/archive/types.rb +9 -0
- data/lib/kanrisuru/core/archive.rb +3 -121
- data/lib/kanrisuru/core/disk/commands/blkid.rb +35 -0
- data/lib/kanrisuru/core/disk/commands/df.rb +26 -0
- data/lib/kanrisuru/core/disk/commands/du.rb +24 -0
- data/lib/kanrisuru/core/disk/commands/lsblk.rb +54 -0
- data/lib/kanrisuru/core/disk/commands.rb +6 -0
- data/lib/kanrisuru/core/disk/parser.rb +6 -0
- data/lib/kanrisuru/core/disk/parsers/blkid.rb +72 -0
- data/lib/kanrisuru/core/disk/parsers/df.rb +33 -0
- data/lib/kanrisuru/core/disk/parsers/du.rb +25 -0
- data/lib/kanrisuru/core/disk/parsers/lsblk.rb +96 -0
- data/lib/kanrisuru/core/disk/types.rb +21 -0
- data/lib/kanrisuru/core/disk.rb +5 -290
- data/lib/kanrisuru/core/dmi/commands/dmi.rb +42 -0
- data/lib/kanrisuru/core/dmi/commands.rb +3 -0
- data/lib/kanrisuru/core/dmi/parser.rb +3 -0
- data/lib/kanrisuru/core/dmi/parsers/dmi.rb +149 -0
- data/lib/kanrisuru/core/dmi/types.rb +361 -0
- data/lib/kanrisuru/core/dmi.rb +4 -522
- data/lib/kanrisuru/core/file/commands/chmod.rb +29 -0
- data/lib/kanrisuru/core/file/commands/chown.rb +35 -0
- data/lib/kanrisuru/core/file/commands/copy.rb +56 -0
- data/lib/kanrisuru/core/file/commands/link.rb +25 -0
- data/lib/kanrisuru/core/file/commands/mkdir.rb +37 -0
- data/lib/kanrisuru/core/file/commands/move.rb +48 -0
- data/lib/kanrisuru/core/file/commands/rm.rb +38 -0
- data/lib/kanrisuru/core/file/commands/symlink.rb +46 -0
- data/lib/kanrisuru/core/file/commands/touch.rb +33 -0
- data/lib/kanrisuru/core/file/commands/unlink.rb +13 -0
- data/lib/kanrisuru/core/file/commands/wc.rb +16 -0
- data/lib/kanrisuru/core/file/commands.rb +29 -0
- data/lib/kanrisuru/core/file/parser.rb +3 -0
- data/lib/kanrisuru/core/file/parsers/wc.rb +16 -0
- data/lib/kanrisuru/core/file/types.rb +9 -0
- data/lib/kanrisuru/core/file.rb +4 -312
- data/lib/kanrisuru/core/find/commands/find.rb +97 -0
- data/lib/kanrisuru/core/find/commands.rb +3 -0
- data/lib/kanrisuru/core/find/constants.rb +9 -0
- data/lib/kanrisuru/core/find/parser.rb +3 -0
- data/lib/kanrisuru/core/find/parsers/find.rb +18 -0
- data/lib/kanrisuru/core/find/types.rb +9 -0
- data/lib/kanrisuru/core/find.rb +5 -97
- data/lib/kanrisuru/core/group/commands/create_group.rb +21 -0
- data/lib/kanrisuru/core/group/commands/delete_group.rb +16 -0
- data/lib/kanrisuru/core/group/commands/get_gid.rb +17 -0
- data/lib/kanrisuru/core/group/commands/get_group.rb +29 -0
- data/lib/kanrisuru/core/group/commands/is_group.rb +14 -0
- data/lib/kanrisuru/core/group/commands/update_group.rb +23 -0
- data/lib/kanrisuru/core/group/commands.rb +8 -0
- data/lib/kanrisuru/core/group/parser.rb +4 -0
- data/lib/kanrisuru/core/group/parsers/gid.rb +15 -0
- data/lib/kanrisuru/core/group/parsers/group.rb +15 -0
- data/lib/kanrisuru/core/group/types.rb +10 -0
- data/lib/kanrisuru/core/group.rb +4 -81
- data/lib/kanrisuru/core/ip/commands/address.rb +86 -0
- data/lib/kanrisuru/core/ip/commands/address_label.rb +54 -0
- data/lib/kanrisuru/core/ip/commands/link.rb +116 -0
- data/lib/kanrisuru/core/ip/commands/link_set_opts.rb +61 -0
- data/lib/kanrisuru/core/ip/commands/link_type_opts.rb +313 -0
- data/lib/kanrisuru/core/ip/commands/maddress.rb +42 -0
- data/lib/kanrisuru/core/ip/commands/neighbour.rb +72 -0
- data/lib/kanrisuru/core/ip/commands/route.rb +152 -0
- data/lib/kanrisuru/core/ip/commands/rule.rb +57 -0
- data/lib/kanrisuru/core/ip/commands.rb +26 -0
- data/lib/kanrisuru/core/ip/constants.rb +25 -0
- data/lib/kanrisuru/core/ip/parser.rb +11 -0
- data/lib/kanrisuru/core/ip/parsers/address.rb +104 -0
- data/lib/kanrisuru/core/ip/parsers/address_label.rb +27 -0
- data/lib/kanrisuru/core/ip/parsers/base.rb +166 -0
- data/lib/kanrisuru/core/ip/parsers/link.rb +86 -0
- data/lib/kanrisuru/core/ip/parsers/maddress.rb +85 -0
- data/lib/kanrisuru/core/ip/parsers/neighbour.rb +89 -0
- data/lib/kanrisuru/core/ip/parsers/route.rb +76 -0
- data/lib/kanrisuru/core/ip/parsers/rule.rb +60 -0
- data/lib/kanrisuru/core/ip/parsers/version.rb +15 -0
- data/lib/kanrisuru/core/ip/types.rb +46 -0
- data/lib/kanrisuru/core/ip.rb +15 -1002
- data/lib/kanrisuru/core/mount/commands/mount.rb +65 -0
- data/lib/kanrisuru/core/mount/commands/umount.rb +35 -0
- data/lib/kanrisuru/core/mount/commands.rb +49 -0
- data/lib/kanrisuru/core/mount.rb +2 -125
- data/lib/kanrisuru/core/path/commands/ls.rb +26 -0
- data/lib/kanrisuru/core/path/commands/pwd.rb +16 -0
- data/lib/kanrisuru/core/path/commands/readlink.rb +22 -0
- data/lib/kanrisuru/core/path/commands/realpath.rb +18 -0
- data/lib/kanrisuru/core/path/commands/which.rb +19 -0
- data/lib/kanrisuru/core/path/commands/whoami.rb +16 -0
- data/lib/kanrisuru/core/path/commands.rb +8 -0
- data/lib/kanrisuru/core/path/parser.rb +4 -0
- data/lib/kanrisuru/core/path/parsers/ls.rb +53 -0
- data/lib/kanrisuru/core/path/parsers/which.rb +18 -0
- data/lib/kanrisuru/core/path/types.rb +12 -0
- data/lib/kanrisuru/core/path.rb +4 -121
- data/lib/kanrisuru/core/socket/commands/ss.rb +44 -0
- data/lib/kanrisuru/core/socket/commands.rb +3 -0
- data/lib/kanrisuru/core/socket/constants.rb +29 -0
- data/lib/kanrisuru/core/socket/parser.rb +3 -0
- data/lib/kanrisuru/core/socket/parsers/ss.rb +109 -0
- data/lib/kanrisuru/core/socket/types.rb +18 -0
- data/lib/kanrisuru/core/socket.rb +5 -164
- data/lib/kanrisuru/core/stat/commands/stat.rb +62 -0
- data/lib/kanrisuru/core/stat/commands.rb +3 -0
- data/lib/kanrisuru/core/stat/parser.rb +3 -0
- data/lib/kanrisuru/core/stat/parsers/stat.rb +34 -0
- data/lib/kanrisuru/core/stat/types.rb +14 -0
- data/lib/kanrisuru/core/stat.rb +4 -81
- data/lib/kanrisuru/core/stream/commands/cat.rb +25 -0
- data/lib/kanrisuru/core/stream/commands/echo.rb +20 -0
- data/lib/kanrisuru/core/stream/commands/head.rb +18 -0
- data/lib/kanrisuru/core/stream/commands/read_file_chunk.rb +21 -0
- data/lib/kanrisuru/core/stream/commands/sed.rb +23 -0
- data/lib/kanrisuru/core/stream/commands/tail.rb +18 -0
- data/lib/kanrisuru/core/stream/commands.rb +27 -0
- data/lib/kanrisuru/core/stream/parser.rb +4 -0
- data/lib/kanrisuru/core/stream/parsers/echo.rb +17 -0
- data/lib/kanrisuru/core/stream/parsers/sed.rb +17 -0
- data/lib/kanrisuru/core/stream.rb +3 -104
- data/lib/kanrisuru/core/system/commands/cpu_info.rb +32 -0
- data/lib/kanrisuru/core/system/commands/free.rb +25 -0
- data/lib/kanrisuru/core/system/commands/kernel_statistics.rb +21 -0
- data/lib/kanrisuru/core/system/commands/kill.rb +22 -0
- data/lib/kanrisuru/core/system/commands/last.rb +31 -0
- data/lib/kanrisuru/core/system/commands/load_average.rb +16 -0
- data/lib/kanrisuru/core/system/commands/load_env.rb +16 -0
- data/lib/kanrisuru/core/system/commands/lscpu.rb +17 -0
- data/lib/kanrisuru/core/system/commands/lsof.rb +16 -0
- data/lib/kanrisuru/core/system/commands/poweroff.rb +42 -0
- data/lib/kanrisuru/core/system/commands/ps.rb +35 -0
- data/lib/kanrisuru/core/system/commands/reboot.rb +42 -0
- data/lib/kanrisuru/core/system/commands/uptime.rb +18 -0
- data/lib/kanrisuru/core/system/commands/w.rb +24 -0
- data/lib/kanrisuru/core/system/commands.rb +34 -0
- data/lib/kanrisuru/core/system/parser.rb +11 -0
- data/lib/kanrisuru/core/system/parsers/kernel_statistics.rb +56 -0
- data/lib/kanrisuru/core/system/parsers/last.rb +64 -0
- data/lib/kanrisuru/core/system/parsers/load_average.rb +15 -0
- data/lib/kanrisuru/core/system/parsers/load_env.rb +24 -0
- data/lib/kanrisuru/core/system/parsers/lscpu.rb +90 -0
- data/lib/kanrisuru/core/system/parsers/lsof.rb +62 -0
- data/lib/kanrisuru/core/system/parsers/ps.rb +71 -0
- data/lib/kanrisuru/core/system/parsers/uptime.rb +38 -0
- data/lib/kanrisuru/core/system/parsers/w.rb +30 -0
- data/lib/kanrisuru/core/system/types.rb +108 -0
- data/lib/kanrisuru/core/system.rb +4 -687
- data/lib/kanrisuru/core/transfer/commands/download.rb +26 -0
- data/lib/kanrisuru/core/transfer/commands/upload.rb +23 -0
- data/lib/kanrisuru/core/transfer/commands/wget.rb +168 -0
- data/lib/kanrisuru/core/transfer/commands.rb +5 -0
- data/lib/kanrisuru/core/transfer/constants.rb +10 -0
- data/lib/kanrisuru/core/transfer.rb +3 -199
- data/lib/kanrisuru/core/user/commands/create_user.rb +57 -0
- data/lib/kanrisuru/core/user/commands/delete_user.rb +20 -0
- data/lib/kanrisuru/core/user/commands/get_uid.rb +15 -0
- data/lib/kanrisuru/core/user/commands/get_user.rb +48 -0
- data/lib/kanrisuru/core/user/commands/is_user.rb +14 -0
- data/lib/kanrisuru/core/user/commands/update_user.rb +63 -0
- data/lib/kanrisuru/core/user/commands.rb +8 -0
- data/lib/kanrisuru/core/user/parser.rb +4 -0
- data/lib/kanrisuru/core/user/parsers/getent.rb +17 -0
- data/lib/kanrisuru/core/user/parsers/groups.rb +17 -0
- data/lib/kanrisuru/core/user/types.rb +11 -0
- data/lib/kanrisuru/core/user.rb +4 -182
- data/lib/kanrisuru/core/yum/commands/autoremove.rb +14 -0
- data/lib/kanrisuru/core/yum/commands/clean.rb +23 -0
- data/lib/kanrisuru/core/yum/commands/erase.rb +20 -0
- data/lib/kanrisuru/core/yum/commands/info.rb +21 -0
- data/lib/kanrisuru/core/yum/commands/install.rb +18 -0
- data/lib/kanrisuru/core/yum/commands/list.rb +30 -0
- data/lib/kanrisuru/core/yum/commands/localinstall.rb +22 -0
- data/lib/kanrisuru/core/yum/commands/remove.rb +20 -0
- data/lib/kanrisuru/core/yum/commands/repolist.rb +20 -0
- data/lib/kanrisuru/core/yum/commands/search.rb +21 -0
- data/lib/kanrisuru/core/yum/commands/update.rb +14 -0
- data/lib/kanrisuru/core/yum/commands/upgrade.rb +14 -0
- data/lib/kanrisuru/core/yum/commands.rb +39 -0
- data/lib/kanrisuru/core/yum/parser.rb +7 -0
- data/lib/kanrisuru/core/yum/parsers/base.rb +31 -0
- data/lib/kanrisuru/core/yum/parsers/info.rb +69 -0
- data/lib/kanrisuru/core/yum/parsers/list.rb +24 -0
- data/lib/kanrisuru/core/yum/parsers/repolist.rb +60 -0
- data/lib/kanrisuru/core/yum/parsers/search.rb +30 -0
- data/lib/kanrisuru/core/yum/types.rb +41 -0
- data/lib/kanrisuru/core/yum.rb +4 -347
- data/lib/kanrisuru/core/zypper/commands/add_lock.rb +22 -0
- data/lib/kanrisuru/core/zypper/commands/add_repo.rb +38 -0
- data/lib/kanrisuru/core/zypper/commands/add_service.rb +26 -0
- data/lib/kanrisuru/core/zypper/commands/clean_cache.rb +22 -0
- data/lib/kanrisuru/core/zypper/commands/clean_locks.rb +17 -0
- data/lib/kanrisuru/core/zypper/commands/dist_upgrade.rb +25 -0
- data/lib/kanrisuru/core/zypper/commands/info.rb +25 -0
- data/lib/kanrisuru/core/zypper/commands/install.rb +39 -0
- data/lib/kanrisuru/core/zypper/commands/install_new_recommends.rb +23 -0
- data/lib/kanrisuru/core/zypper/commands/list_locks.rb +22 -0
- data/lib/kanrisuru/core/zypper/commands/list_patches.rb +34 -0
- data/lib/kanrisuru/core/zypper/commands/list_repos.rb +21 -0
- data/lib/kanrisuru/core/zypper/commands/list_services.rb +21 -0
- data/lib/kanrisuru/core/zypper/commands/list_updates.rb +30 -0
- data/lib/kanrisuru/core/zypper/commands/modify_repo.rb +48 -0
- data/lib/kanrisuru/core/zypper/commands/modify_service.rb +40 -0
- data/lib/kanrisuru/core/zypper/commands/patch.rb +40 -0
- data/lib/kanrisuru/core/zypper/commands/patch_check.rb +29 -0
- data/lib/kanrisuru/core/zypper/commands/purge_kernels.rb +18 -0
- data/lib/kanrisuru/core/zypper/commands/refresh_repos.rb +24 -0
- data/lib/kanrisuru/core/zypper/commands/refresh_services.rb +21 -0
- data/lib/kanrisuru/core/zypper/commands/remove.rb +26 -0
- data/lib/kanrisuru/core/zypper/commands/remove_lock.rb +22 -0
- data/lib/kanrisuru/core/zypper/commands/remove_repo.rb +32 -0
- data/lib/kanrisuru/core/zypper/commands/remove_service.rb +21 -0
- data/lib/kanrisuru/core/zypper/commands/rename_repo.rb +20 -0
- data/lib/kanrisuru/core/zypper/commands/search.rb +52 -0
- data/lib/kanrisuru/core/zypper/commands/source_install.rb +22 -0
- data/lib/kanrisuru/core/zypper/commands/update.rb +27 -0
- data/lib/kanrisuru/core/zypper/commands/verify.rb +23 -0
- data/lib/kanrisuru/core/zypper/commands.rb +109 -0
- data/lib/kanrisuru/core/zypper/constants.rb +19 -0
- data/lib/kanrisuru/core/zypper/parser.rb +11 -0
- data/lib/kanrisuru/core/zypper/parsers/base.rb +18 -0
- data/lib/kanrisuru/core/zypper/parsers/info.rb +77 -0
- data/lib/kanrisuru/core/zypper/parsers/list_locks.rb +36 -0
- data/lib/kanrisuru/core/zypper/parsers/list_patches.rb +40 -0
- data/lib/kanrisuru/core/zypper/parsers/list_repos.rb +37 -0
- data/lib/kanrisuru/core/zypper/parsers/list_services.rb +36 -0
- data/lib/kanrisuru/core/zypper/parsers/list_updates.rb +32 -0
- data/lib/kanrisuru/core/zypper/parsers/patch_check.rb +34 -0
- data/lib/kanrisuru/core/zypper/parsers/search.rb +37 -0
- data/lib/kanrisuru/core/zypper/types.rb +88 -0
- data/lib/kanrisuru/core/zypper.rb +5 -998
- data/lib/kanrisuru/version.rb +1 -1
- data/spec/functional/core/ip/ip_address_label_spec.rb +81 -0
- data/spec/functional/core/ip/ip_address_spec.rb +95 -0
- data/spec/functional/core/ip/ip_link_spec.rb +814 -0
- data/spec/functional/core/ip/ip_maddress_spec.rb +78 -0
- data/spec/functional/core/ip/ip_neighbour_spec.rb +119 -0
- data/spec/functional/core/ip/ip_route_spec.rb +174 -0
- data/spec/functional/core/ip/ip_rule_spec.rb +75 -0
- data/spec/functional/core/ip/ip_spec.rb +27 -0
- data/spec/functional/result_spec.rb +150 -0
- data/spec/{hosts.json → helper/hosts.json} +0 -0
- data/spec/helper/simplecov.rb +21 -0
- data/spec/helper/test_hosts.rb +3 -3
- data/spec/integration/core/apt/debian_spec.rb +9 -0
- data/spec/integration/core/apt/ubuntu_spec.rb +9 -0
- data/spec/integration/core/archive/centos_spec.rb +9 -0
- data/spec/integration/core/archive/debian_spec.rb +9 -0
- data/spec/integration/core/archive/fedora_spec.rb +9 -0
- data/spec/integration/core/archive/opensuse_spec.rb +9 -0
- data/spec/integration/core/archive/rhel_spec.rb +9 -0
- data/spec/integration/core/archive/sles_spec.rb +9 -0
- data/spec/integration/core/archive/ubuntu_spec.rb +9 -0
- data/spec/integration/core/disk/centos_spec.rb +9 -0
- data/spec/integration/core/disk/debian_spec.rb +9 -0
- data/spec/integration/core/disk/fedora_spec.rb +9 -0
- data/spec/integration/core/disk/opensuse_spec.rb +9 -0
- data/spec/integration/core/disk/rhel_spec.rb +9 -0
- data/spec/integration/core/disk/sles_spec.rb +9 -0
- data/spec/integration/core/disk/ubuntu_spec.rb +9 -0
- data/spec/integration/core/dmi/centos_spec.rb +9 -0
- data/spec/integration/core/dmi/debian_spec.rb +9 -0
- data/spec/integration/core/dmi/fedora_spec.rb +9 -0
- data/spec/integration/core/dmi/opensuse_spec.rb +9 -0
- data/spec/integration/core/dmi/rhel_spec.rb +9 -0
- data/spec/integration/core/dmi/sles_spec.rb +9 -0
- data/spec/integration/core/dmi/ubuntu_spec.rb +9 -0
- data/spec/integration/core/file/centos_spec.rb +9 -0
- data/spec/integration/core/file/debian_spec.rb +9 -0
- data/spec/integration/core/file/fedora_spec.rb +9 -0
- data/spec/integration/core/file/opensuse_spec.rb +9 -0
- data/spec/integration/core/file/rhel_spec.rb +9 -0
- data/spec/integration/core/file/sles_spec.rb +9 -0
- data/spec/integration/core/file/ubuntu_spec.rb +9 -0
- data/spec/integration/core/find/centos_spec.rb +9 -0
- data/spec/integration/core/find/debian_spec.rb +9 -0
- data/spec/integration/core/find/fedora_spec.rb +9 -0
- data/spec/integration/core/find/opensuse_spec.rb +9 -0
- data/spec/integration/core/find/rhel_spec.rb +9 -0
- data/spec/integration/core/find/sles_spec.rb +9 -0
- data/spec/integration/core/find/ubuntu_spec.rb +9 -0
- data/spec/integration/core/group/centos_spec.rb +9 -0
- data/spec/integration/core/group/debian_spec.rb +9 -0
- data/spec/integration/core/group/fedora_spec.rb +9 -0
- data/spec/integration/core/group/opensuse_spec.rb +9 -0
- data/spec/integration/core/group/rhel_spec.rb +9 -0
- data/spec/integration/core/group/sles_spec.rb +9 -0
- data/spec/integration/core/group/ubuntu_spec.rb +9 -0
- data/spec/integration/core/ip/centos_spec.rb +9 -0
- data/spec/integration/core/ip/debian_spec.rb +9 -0
- data/spec/integration/core/ip/fedora_spec.rb +9 -0
- data/spec/integration/core/ip/opensuse_spec.rb +9 -0
- data/spec/integration/core/ip/rhel_spec.rb +9 -0
- data/spec/integration/core/ip/sles_spec.rb +9 -0
- data/spec/integration/core/ip/ubuntu_spec.rb +9 -0
- data/spec/integration/core/path/centos_spec.rb +9 -0
- data/spec/integration/core/path/debian_spec.rb +9 -0
- data/spec/integration/core/path/fedora_spec.rb +9 -0
- data/spec/integration/core/path/opensuse_spec.rb +9 -0
- data/spec/integration/core/path/rhel_spec.rb +9 -0
- data/spec/integration/core/path/sles_spec.rb +9 -0
- data/spec/integration/core/path/ubuntu_spec.rb +9 -0
- data/spec/integration/core/socket/centos_spec.rb +9 -0
- data/spec/integration/core/socket/debian_spec.rb +9 -0
- data/spec/integration/core/socket/fedora_spec.rb +9 -0
- data/spec/integration/core/socket/opensuse_spec.rb +9 -0
- data/spec/integration/core/socket/rhel_spec.rb +9 -0
- data/spec/integration/core/socket/sles_spec.rb +9 -0
- data/spec/integration/core/socket/ubuntu_spec.rb +9 -0
- data/spec/integration/core/stat/centos_spec.rb +9 -0
- data/spec/integration/core/stat/debian_spec.rb +9 -0
- data/spec/integration/core/stat/fedora_spec.rb +9 -0
- data/spec/integration/core/stat/opensuse_spec.rb +9 -0
- data/spec/integration/core/stat/rhel_spec.rb +9 -0
- data/spec/integration/core/stat/sles_spec.rb +9 -0
- data/spec/integration/core/stat/ubuntu_spec.rb +9 -0
- data/spec/integration/core/stream/centos_spec.rb +9 -0
- data/spec/integration/core/stream/debian_spec.rb +9 -0
- data/spec/integration/core/stream/fedora_spec.rb +9 -0
- data/spec/integration/core/stream/opensuse_spec.rb +9 -0
- data/spec/integration/core/stream/rhel_spec.rb +9 -0
- data/spec/integration/core/stream/sles_spec.rb +9 -0
- data/spec/integration/core/stream/ubuntu_spec.rb +9 -0
- data/spec/integration/core/system/centos_spec.rb +9 -0
- data/spec/integration/core/system/debian_spec.rb +9 -0
- data/spec/integration/core/system/fedora_spec.rb +9 -0
- data/spec/integration/core/system/opensuse_spec.rb +9 -0
- data/spec/integration/core/system/rhel_spec.rb +9 -0
- data/spec/integration/core/system/sles_spec.rb +9 -0
- data/spec/integration/core/system/ubuntu_spec.rb +9 -0
- data/spec/integration/core/transfer/centos_spec.rb +9 -0
- data/spec/integration/core/transfer/debian_spec.rb +9 -0
- data/spec/integration/core/transfer/fedora_spec.rb +9 -0
- data/spec/integration/core/transfer/opensuse_spec.rb +9 -0
- data/spec/integration/core/transfer/rhel_spec.rb +9 -0
- data/spec/integration/core/transfer/sles_spec.rb +9 -0
- data/spec/integration/core/transfer/ubuntu_spec.rb +9 -0
- data/spec/integration/core/user/centos_spec.rb +9 -0
- data/spec/integration/core/user/debian_spec.rb +9 -0
- data/spec/integration/core/user/fedora_spec.rb +9 -0
- data/spec/integration/core/user/opensuse_spec.rb +9 -0
- data/spec/integration/core/user/rhel_spec.rb +9 -0
- data/spec/integration/core/user/sles_spec.rb +9 -0
- data/spec/integration/core/user/ubuntu_spec.rb +9 -0
- data/spec/integration/core/yum/centos_spec.rb +9 -0
- data/spec/integration/core/yum/fedora_spec.rb +9 -0
- data/spec/integration/core/yum/rhel_spec.rb +9 -0
- data/spec/integration/core/zypper/opensuse_spec.rb +9 -0
- data/spec/integration/core/zypper/sles_spec.rb +9 -0
- data/spec/integration/remote/cluster/ubuntu_spec.rb +9 -0
- data/spec/integration/remote/cpu/centos_spec.rb +9 -0
- data/spec/integration/remote/cpu/debian_spec.rb +9 -0
- data/spec/integration/remote/cpu/fedora_spec.rb +9 -0
- data/spec/integration/remote/cpu/opensuse_spec.rb +9 -0
- data/spec/integration/remote/cpu/rhel_spec.rb +9 -0
- data/spec/integration/remote/cpu/sles_spec.rb +9 -0
- data/spec/integration/remote/cpu/ubuntu_spec.rb +9 -0
- data/spec/integration/remote/env/centos_spec.rb +9 -0
- data/spec/integration/remote/env/debian_spec.rb +9 -0
- data/spec/integration/remote/env/fedora_spec.rb +9 -0
- data/spec/integration/remote/env/opensuse_spec.rb +9 -0
- data/spec/integration/remote/env/rhel_spec.rb +9 -0
- data/spec/integration/remote/env/sles_spec.rb +9 -0
- data/spec/integration/remote/env/ubuntu_spec.rb +9 -0
- data/spec/integration/remote/fstab/centos_spec.rb +9 -0
- data/spec/integration/remote/fstab/debian_spec.rb +9 -0
- data/spec/integration/remote/fstab/fedora_spec.rb +9 -0
- data/spec/integration/remote/fstab/opensuse_spec.rb +9 -0
- data/spec/integration/remote/fstab/rhel_spec.rb +9 -0
- data/spec/integration/remote/fstab/sles_spec.rb +9 -0
- data/spec/integration/remote/fstab/ubuntu_spec.rb +9 -0
- data/spec/integration/remote/host/centos_spec.rb +9 -0
- data/spec/integration/remote/host/debian_spec.rb +9 -0
- data/spec/integration/remote/host/fedora_spec.rb +9 -0
- data/spec/integration/remote/host/opensuse_spec.rb +9 -0
- data/spec/integration/remote/host/rhel_spec.rb +9 -0
- data/spec/integration/remote/host/sles_spec.rb +9 -0
- data/spec/integration/remote/host/ubuntu_spec.rb +9 -0
- data/spec/integration/remote/memory/centos_spec.rb +9 -0
- data/spec/integration/remote/memory/debian_spec.rb +9 -0
- data/spec/integration/remote/memory/fedora_spec.rb +9 -0
- data/spec/integration/remote/memory/opensuse_spec.rb +9 -0
- data/spec/integration/remote/memory/rhel_spec.rb +9 -0
- data/spec/integration/remote/memory/sles_spec.rb +9 -0
- data/spec/integration/remote/memory/ubuntu_spec.rb +9 -0
- data/spec/integration/remote/os/centos_spec.rb +9 -0
- data/spec/integration/remote/os/debian_spec.rb +9 -0
- data/spec/integration/remote/os/fedora_spec.rb +9 -0
- data/spec/integration/remote/os/opensuse_spec.rb +9 -0
- data/spec/integration/remote/os/rhel_spec.rb +9 -0
- data/spec/integration/remote/os/sles_spec.rb +9 -0
- data/spec/integration/remote/os/ubuntu_spec.rb +9 -0
- data/spec/integration/remote/remote_file/centos_spec.rb +9 -0
- data/spec/integration/remote/remote_file/debian_spec.rb +9 -0
- data/spec/integration/remote/remote_file/fedora_spec.rb +9 -0
- data/spec/integration/remote/remote_file/opensuse_spec.rb +9 -0
- data/spec/integration/remote/remote_file/rhel_spec.rb +9 -0
- data/spec/integration/remote/remote_file/sles_spec.rb +9 -0
- data/spec/integration/remote/remote_file/ubuntu_spec.rb +9 -0
- data/spec/spec_helper.rb +2 -11
- data/spec/support/shared_examples/integration/core/apt.rb +117 -0
- data/spec/support/shared_examples/integration/core/archive.rb +221 -0
- data/spec/support/shared_examples/integration/core/disk.rb +91 -0
- data/spec/support/shared_examples/integration/core/dmi.rb +34 -0
- data/spec/support/shared_examples/integration/core/file.rb +357 -0
- data/spec/support/shared_examples/integration/core/find.rb +50 -0
- data/spec/support/shared_examples/integration/core/group.rb +62 -0
- data/spec/support/shared_examples/integration/core/ip.rb +68 -0
- data/spec/support/shared_examples/integration/core/path.rb +90 -0
- data/spec/support/shared_examples/integration/core/socket.rb +27 -0
- data/spec/support/shared_examples/integration/core/stat.rb +95 -0
- data/spec/support/shared_examples/integration/core/stream.rb +112 -0
- data/spec/support/shared_examples/integration/core/system.rb +155 -0
- data/spec/support/shared_examples/integration/core/transfer.rb +101 -0
- data/spec/support/shared_examples/integration/core/user.rb +72 -0
- data/spec/support/shared_examples/integration/core/yum.rb +115 -0
- data/spec/support/shared_examples/integration/core/zypper.rb +196 -0
- data/spec/{integration/remote/cluster_spec.rb → support/shared_examples/integration/remote/cluster.rb} +2 -2
- data/spec/support/shared_examples/integration/remote/cpu.rb +38 -0
- data/spec/support/shared_examples/integration/remote/env_spec.rb +33 -0
- data/spec/support/shared_examples/integration/remote/fstab.rb +89 -0
- data/spec/support/shared_examples/integration/remote/host.rb +65 -0
- data/spec/support/shared_examples/integration/remote/memory.rb +27 -0
- data/spec/support/shared_examples/integration/remote/os.rb +60 -0
- data/spec/support/shared_examples/integration/remote/remote_file.rb +172 -0
- data/spec/unit/util_spec.rb +16 -0
- metadata +425 -29
- data/spec/integration/core/apt_spec.rb +0 -119
- data/spec/integration/core/archive_spec.rb +0 -223
- data/spec/integration/core/disk_spec.rb +0 -93
- data/spec/integration/core/dmi_spec.rb +0 -36
- data/spec/integration/core/file_spec.rb +0 -359
- data/spec/integration/core/find_spec.rb +0 -52
- data/spec/integration/core/group_spec.rb +0 -64
- data/spec/integration/core/ip_spec.rb +0 -70
- data/spec/integration/core/path_spec.rb +0 -92
- data/spec/integration/core/socket_spec.rb +0 -29
- data/spec/integration/core/stat_spec.rb +0 -97
- data/spec/integration/core/stream_spec.rb +0 -114
- data/spec/integration/core/system_spec.rb +0 -142
- data/spec/integration/core/transfer_spec.rb +0 -103
- data/spec/integration/core/user_spec.rb +0 -74
- data/spec/integration/core/yum_spec.rb +0 -117
- data/spec/integration/core/zypper_spec.rb +0 -198
- data/spec/integration/remote/cpu_spec.rb +0 -40
- data/spec/integration/remote/env_spec.rb +0 -35
- data/spec/integration/remote/fstab_spec.rb +0 -91
- data/spec/integration/remote/host_spec.rb +0 -67
- data/spec/integration/remote/memory_spec.rb +0 -29
- data/spec/integration/remote/os_spec.rb +0 -62
- data/spec/integration/remote/remote_file_spec.rb +0 -174
- data/spec/zz_reboot_spec.rb +0 -46
@@ -0,0 +1,814 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::IP do
|
6
|
+
before(:all) do
|
7
|
+
StubNetwork.stub!
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:all) do
|
11
|
+
StubNetwork.unstub!
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:host) do
|
15
|
+
Kanrisuru::Remote::Host.new(
|
16
|
+
host: 'localhost',
|
17
|
+
username: 'ubuntu',
|
18
|
+
keys: ['id_rsa']
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
%w[link l].each do |object_variant|
|
23
|
+
context "with ip #{object_variant}" do
|
24
|
+
context 'with json support' do
|
25
|
+
before(:all) do
|
26
|
+
StubNetwork.stub_command!(:ip_version) do
|
27
|
+
Kanrisuru::Core::IP::IPROUTE2_JSON_VERSION
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
after(:all) do
|
32
|
+
StubNetwork.unstub_command!(:ip_version)
|
33
|
+
end
|
34
|
+
|
35
|
+
%w[show list].each do |action_variant|
|
36
|
+
it "prepares #{action_variant} command" do
|
37
|
+
expect_command(host.ip(object_variant, action_variant), 'ip -json link show')
|
38
|
+
expect_command(host.ip(object_variant, action_variant, {
|
39
|
+
stats: true,
|
40
|
+
family: 'inet',
|
41
|
+
dev: 'eth0',
|
42
|
+
up: true
|
43
|
+
}), 'ip -json -s -family inet link show dev eth0 up')
|
44
|
+
|
45
|
+
expect_command(host.ip(object_variant, action_variant, {
|
46
|
+
dev: 'eth0.10',
|
47
|
+
group: '0',
|
48
|
+
master: 'eth0',
|
49
|
+
vrf: 'red',
|
50
|
+
type: 'vlan'
|
51
|
+
}), 'ip -json link show dev eth0.10 group 0 master eth0 type vlan vrf red')
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'without json support' do
|
57
|
+
before(:all) do
|
58
|
+
StubNetwork.stub_command!(:ip_version) do
|
59
|
+
Kanrisuru::Core::IP::IPROUTE2_JSON_VERSION - 1
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
after(:all) do
|
64
|
+
StubNetwork.unstub_command!(:ip_version)
|
65
|
+
end
|
66
|
+
|
67
|
+
%w[show list].each do |action_variant|
|
68
|
+
it "prepares #{action_variant} command" do
|
69
|
+
expect_command(host.ip(object_variant, action_variant), 'ip link show')
|
70
|
+
expect_command(host.ip(object_variant, action_variant, {
|
71
|
+
stats: true,
|
72
|
+
family: 'inet',
|
73
|
+
dev: 'eth0',
|
74
|
+
up: true
|
75
|
+
}), 'ip -s -family inet link show dev eth0 up')
|
76
|
+
|
77
|
+
expect_command(host.ip(object_variant, action_variant, {
|
78
|
+
dev: 'eth0.10',
|
79
|
+
group: '0',
|
80
|
+
master: 'eth0',
|
81
|
+
vrf: 'red',
|
82
|
+
type: 'vlan'
|
83
|
+
}), 'ip link show dev eth0.10 group 0 master eth0 type vlan vrf red')
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
%w[delete del].each do |action_variant|
|
89
|
+
it "prepares #{action_variant} command" do
|
90
|
+
expect_command(host.ip(object_variant, action_variant, {
|
91
|
+
dev: 'eth2'
|
92
|
+
}), 'ip link delete dev eth2')
|
93
|
+
|
94
|
+
expect_command(host.ip(object_variant, action_variant, {
|
95
|
+
group: '0'
|
96
|
+
}), 'ip link delete group 0')
|
97
|
+
|
98
|
+
expect_command(host.ip(object_variant, action_variant, {
|
99
|
+
type: 'vxlan'
|
100
|
+
}), 'ip link delete type vxlan')
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
%w[add a].each do |action_variant|
|
105
|
+
it "prepares #{action_variant} command" do
|
106
|
+
expect_command(host.ip(object_variant, action_variant, {
|
107
|
+
dev: 'eth0',
|
108
|
+
name: 'eth0',
|
109
|
+
mtu: 9000,
|
110
|
+
index: 1,
|
111
|
+
numttxqueues: 1000,
|
112
|
+
numrxqueues: 1000,
|
113
|
+
gso_max_size: 32,
|
114
|
+
gso_max_segs: 64
|
115
|
+
}), 'ip link add dev eth0 name eth0 mtu 9000 index 1 numrxqueues 1000 gso_max_size 32 gso_max_segs 64')
|
116
|
+
end
|
117
|
+
|
118
|
+
it "prepares #{action_variant} command with vlan" do
|
119
|
+
expect_command(host.ip(object_variant, action_variant, {
|
120
|
+
dev: 'eth0',
|
121
|
+
name: 'eth0.10',
|
122
|
+
type: 'vlan',
|
123
|
+
type_opts: {
|
124
|
+
id: 10,
|
125
|
+
protocol: '802.1Q',
|
126
|
+
reorder_hdr: 'off',
|
127
|
+
gvrp: 'off',
|
128
|
+
mvrp: 'on',
|
129
|
+
loose_binding: 'on',
|
130
|
+
ingress_qos_map: '1:2',
|
131
|
+
egress_qos_map: '2:1'
|
132
|
+
}
|
133
|
+
}), 'ip link add dev eth0 name eth0.10 type vlan protocol 802.1Q id 10 reorder_hdr off gvrp off mvrp on loose_binding on ingress-qos-map 1:2 egress-qos-map 2:1')
|
134
|
+
end
|
135
|
+
|
136
|
+
it "prepares #{action_variant} command with vxlan" do
|
137
|
+
expect_command(host.ip(object_variant, action_variant, {
|
138
|
+
name: 'eth0.5',
|
139
|
+
type: 'vxlan',
|
140
|
+
type_opts: {
|
141
|
+
id: 5,
|
142
|
+
remote: '172.0.0.12',
|
143
|
+
dev: 'eth0',
|
144
|
+
local: '10.0.0.1',
|
145
|
+
ttl: '300',
|
146
|
+
tos: '0x28',
|
147
|
+
df: 'set',
|
148
|
+
flowlabel: 'vxlan-label',
|
149
|
+
dstport: 6082,
|
150
|
+
srcport: '6085 6086',
|
151
|
+
learning: true,
|
152
|
+
rsc: true,
|
153
|
+
proxy: true,
|
154
|
+
l2miss: true,
|
155
|
+
l3miss: true,
|
156
|
+
external: true,
|
157
|
+
udpcsum: true,
|
158
|
+
udp6zerocsumtx: true,
|
159
|
+
udp6zerocsumrx: true,
|
160
|
+
ageing: 3600,
|
161
|
+
maxaddress: 128,
|
162
|
+
gbp: true,
|
163
|
+
gpe: true
|
164
|
+
}
|
165
|
+
}), 'ip link add name eth0.5 type vxlan id 5 dev eth0 remote 172.0.0.12 local 10.0.0.1 ttl 300 tos 0x28 df set flowlabel vxlan-label dstport 6082 srcport 6085 6086 learning rsc proxy l2miss l3miss udpcsum udp6zerocsumtx udp6zerocsumrx ageing 3600 maxaddress 128 gbp gpe')
|
166
|
+
|
167
|
+
expect_command(host.ip(object_variant, action_variant, {
|
168
|
+
name: 'eth0.5',
|
169
|
+
type: 'vxlan',
|
170
|
+
type_opts: {
|
171
|
+
id: 5,
|
172
|
+
remote: '172.0.0.12',
|
173
|
+
dev: 'eth0',
|
174
|
+
learning: false,
|
175
|
+
rsc: false,
|
176
|
+
proxy: false,
|
177
|
+
l2miss: false,
|
178
|
+
l3miss: false,
|
179
|
+
external: false,
|
180
|
+
udpcsum: false,
|
181
|
+
udp6zerocsumtx: false,
|
182
|
+
udp6zerocsumrx: false,
|
183
|
+
gbp: false
|
184
|
+
}
|
185
|
+
}), 'ip link add name eth0.5 type vxlan id 5 dev eth0 remote 172.0.0.12 nolearning norsc noproxy nol2miss nol3miss noudpcsum noudp6zerocsumtx noudp6zerocsumrx')
|
186
|
+
end
|
187
|
+
|
188
|
+
it "prepares #{action_variant} command with veth" do
|
189
|
+
expect_command(host.ip(object_variant, action_variant, {
|
190
|
+
dev: 'eth0',
|
191
|
+
name: 'eth0.10',
|
192
|
+
type: 'veth',
|
193
|
+
type_opts: {
|
194
|
+
peer_name: 'veth-tunnel-connect'
|
195
|
+
}
|
196
|
+
}), 'ip link add dev eth0 name eth0.10 type veth peer name veth-tunnel-connect')
|
197
|
+
end
|
198
|
+
|
199
|
+
it "prepares #{action_variant} command with vxcan" do
|
200
|
+
expect_command(host.ip(object_variant, action_variant, {
|
201
|
+
dev: 'eth0',
|
202
|
+
name: 'eth0.10',
|
203
|
+
type: 'vxcan',
|
204
|
+
type_opts: {
|
205
|
+
peer_name: 'vxcan-tunnel-connect'
|
206
|
+
}
|
207
|
+
}), 'ip link add dev eth0 name eth0.10 type vxcan peer name vxcan-tunnel-connect')
|
208
|
+
end
|
209
|
+
|
210
|
+
%w[ipip sit].each do |type|
|
211
|
+
it "prepares #{action_variant} command with #{type}" do
|
212
|
+
expect_command(host.ip(object_variant, action_variant, {
|
213
|
+
dev: 'eth0',
|
214
|
+
name: 'eth0.10',
|
215
|
+
type: type,
|
216
|
+
type_opts: {
|
217
|
+
remote: '172.0.0.1',
|
218
|
+
local: '10.0.0.2',
|
219
|
+
encap: 'gue',
|
220
|
+
encap_support: 'auto',
|
221
|
+
encap_csum: true,
|
222
|
+
encap_remcsum: true,
|
223
|
+
mode: 'any',
|
224
|
+
external: true
|
225
|
+
}
|
226
|
+
}), "ip link add dev eth0 name eth0.10 type #{type} remote 172.0.0.1 local 10.0.0.2 encap gue encap-csum encap-remcsum external mode any")
|
227
|
+
|
228
|
+
expect_command(host.ip(object_variant, action_variant, {
|
229
|
+
dev: 'eth0',
|
230
|
+
name: 'eth0.10',
|
231
|
+
type: type,
|
232
|
+
type_opts: {
|
233
|
+
remote: '172.0.0.1',
|
234
|
+
local: '10.0.0.2',
|
235
|
+
encap: 'gue',
|
236
|
+
encap_support: 'auto',
|
237
|
+
encap_csum: false,
|
238
|
+
encap_remcsum: false,
|
239
|
+
mode: 'any'
|
240
|
+
}
|
241
|
+
}), "ip link add dev eth0 name eth0.10 type #{type} remote 172.0.0.1 local 10.0.0.2 encap gue noencap-csum noencap-remcsum mode any")
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
%w[gre gretap].each do |type|
|
246
|
+
it "prepares #{action_variant} command with #{type}" do
|
247
|
+
expect_command(host.ip(object_variant, action_variant, {
|
248
|
+
name: 'eth0.10',
|
249
|
+
type: type,
|
250
|
+
type_opts: {
|
251
|
+
remote: '172.0.0.1',
|
252
|
+
local: '10.0.0.2',
|
253
|
+
iseq: true,
|
254
|
+
oseq: true,
|
255
|
+
icsum: true,
|
256
|
+
ocsum: true,
|
257
|
+
ikey: 10,
|
258
|
+
okey: 10,
|
259
|
+
ttl: 300,
|
260
|
+
tos: '0x28',
|
261
|
+
pmtudisc: true,
|
262
|
+
ignore_df: true,
|
263
|
+
dev: 'eth0',
|
264
|
+
encap: 'none',
|
265
|
+
encap_sport: 'auto',
|
266
|
+
encap_csum: true,
|
267
|
+
encap_remcsum: true,
|
268
|
+
external: true
|
269
|
+
}
|
270
|
+
}), "ip link add name eth0.10 type #{type} remote 172.0.0.1 local 10.0.0.2 encap none encap-sport auto encap-csum encap-remcsum external iseq oseq icsum ocsum okey 10 ikey 10 ttl 300 tos 0x28 pmtudisc ignore-df dev eth0")
|
271
|
+
|
272
|
+
expect_command(host.ip(object_variant, action_variant, {
|
273
|
+
name: 'eth0.10',
|
274
|
+
type: type,
|
275
|
+
type_opts: {
|
276
|
+
remote: '172.0.0.1',
|
277
|
+
local: '10.0.0.2',
|
278
|
+
iseq: false,
|
279
|
+
oseq: false,
|
280
|
+
icsum: false,
|
281
|
+
ocsum: false,
|
282
|
+
ikey: false,
|
283
|
+
okey: false,
|
284
|
+
tos: '0x28',
|
285
|
+
pmtudisc: false,
|
286
|
+
ignore_df: false,
|
287
|
+
dev: 'eth0',
|
288
|
+
encap: 'none',
|
289
|
+
encap_sport: 'auto',
|
290
|
+
encap_csum: false,
|
291
|
+
encap_remcsum: false
|
292
|
+
}
|
293
|
+
}), "ip link add name eth0.10 type #{type} remote 172.0.0.1 local 10.0.0.2 encap none encap-sport auto noencap-csum noencap-remcsum noiseq nooseq noicsum noocsum tos 0x28 nopmtudisc noignore-df dev eth0")
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
%w[ip6gre ip6gretap].each do |type|
|
298
|
+
it "prepares #{action_variant} command with #{type}" do
|
299
|
+
expect_command(host.ip(object_variant, action_variant, {
|
300
|
+
dev: 'eth0',
|
301
|
+
name: 'eth0.10',
|
302
|
+
type: type,
|
303
|
+
type_opts: {
|
304
|
+
external: true
|
305
|
+
}
|
306
|
+
}), "ip link add dev eth0 name eth0.10 type #{type} external true")
|
307
|
+
|
308
|
+
expect_command(host.ip(object_variant, action_variant, {
|
309
|
+
dev: 'eth0',
|
310
|
+
name: 'eth0.10',
|
311
|
+
type: type,
|
312
|
+
type_opts: {
|
313
|
+
remote: '172.0.0.1',
|
314
|
+
local: '10.0.0.3',
|
315
|
+
iseq: true,
|
316
|
+
oseq: true,
|
317
|
+
icsum: true,
|
318
|
+
ocsum: true,
|
319
|
+
ikey: 10,
|
320
|
+
okey: 10,
|
321
|
+
hoplimit: 300,
|
322
|
+
encaplimit: 5,
|
323
|
+
flowlabel: 'gre-flow-label',
|
324
|
+
allow_localremote: true,
|
325
|
+
tclass: 'internet'
|
326
|
+
}
|
327
|
+
}), "ip link add dev eth0 name eth0.10 type #{type} remote 172.0.0.1 local 10.0.0.3 iseq oseq icsum ocsum okey 10 ikey 10 hoplimit 300 encaplimit 5 flowlabel gre-flow-label allow-localremote tclass internet")
|
328
|
+
|
329
|
+
expect_command(host.ip(object_variant, action_variant, {
|
330
|
+
dev: 'eth0',
|
331
|
+
name: 'eth0.10',
|
332
|
+
type: type,
|
333
|
+
type_opts: {
|
334
|
+
remote: '172.0.0.1',
|
335
|
+
local: '10.0.0.3',
|
336
|
+
iseq: false,
|
337
|
+
oseq: false,
|
338
|
+
icsum: false,
|
339
|
+
ocsum: false,
|
340
|
+
ikey: false,
|
341
|
+
okey: false,
|
342
|
+
allow_localremote: false
|
343
|
+
}
|
344
|
+
}), "ip link add dev eth0 name eth0.10 type #{type} remote 172.0.0.1 local 10.0.0.3 noiseq nooseq noicsum noocsum noallow-localremote")
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
it "prepares #{action_variant} command with ipoib" do
|
349
|
+
expect_command(host.ip(object_variant, action_variant, {
|
350
|
+
dev: 'eth0',
|
351
|
+
name: 'eth0.10',
|
352
|
+
type: 'ipoib',
|
353
|
+
type_opts: {
|
354
|
+
pkey: '0x8003',
|
355
|
+
mode: 'connected'
|
356
|
+
}
|
357
|
+
}), 'ip link add dev eth0 name eth0.10 type ipoib pkey 0x8003 mode connected')
|
358
|
+
end
|
359
|
+
|
360
|
+
it "prepares #{action_variant} command with erspan" do
|
361
|
+
expect_command(host.ip(object_variant, action_variant, {
|
362
|
+
dev: 'erspan1',
|
363
|
+
name: 'erspan1',
|
364
|
+
type: 'erspan',
|
365
|
+
type_opts: {
|
366
|
+
remote: '172.0.0.1',
|
367
|
+
local: '10.0.0.4',
|
368
|
+
erspan_ver: 2,
|
369
|
+
erspan: '1',
|
370
|
+
erspan_dir: 'ingress',
|
371
|
+
erspan_hwid: '17',
|
372
|
+
allow_localremote: true
|
373
|
+
}
|
374
|
+
}), 'ip link add dev erspan1 name erspan1 type erspan remote 172.0.0.1 local 10.0.0.4 erspan_ver 2 erspan 1 erspan_dir ingress erspan_hwid 17 allow-localremote')
|
375
|
+
|
376
|
+
expect_command(host.ip(object_variant, action_variant, {
|
377
|
+
dev: 'erspan2',
|
378
|
+
name: 'erspan2',
|
379
|
+
type: 'erspan',
|
380
|
+
type_opts: {
|
381
|
+
remote: '172.0.0.1',
|
382
|
+
local: '10.0.0.4',
|
383
|
+
allow_localremote: false
|
384
|
+
}
|
385
|
+
}), 'ip link add dev erspan2 name erspan2 type erspan remote 172.0.0.1 local 10.0.0.4 noallow-localremote')
|
386
|
+
|
387
|
+
expect_command(host.ip(object_variant, action_variant, {
|
388
|
+
dev: 'erspan3',
|
389
|
+
name: 'erspan3',
|
390
|
+
type: 'erspan',
|
391
|
+
type_opts: {
|
392
|
+
external: true
|
393
|
+
}
|
394
|
+
}), 'ip link add dev erspan3 name erspan3 type erspan external')
|
395
|
+
end
|
396
|
+
|
397
|
+
it "prepares #{action_variant} command with ip6erspan" do
|
398
|
+
expect_command(host.ip(object_variant, action_variant, {
|
399
|
+
dev: 'ip6erspan1',
|
400
|
+
name: 'ip6erspan1',
|
401
|
+
type: 'ip6erspan',
|
402
|
+
type_opts: {
|
403
|
+
remote: 'fc00:100::1',
|
404
|
+
local: 'fc00:100::1',
|
405
|
+
erspan_ver: 2,
|
406
|
+
erspan: '1',
|
407
|
+
erspan_dir: 'ingress',
|
408
|
+
erspan_hwid: '17',
|
409
|
+
allow_localremote: true
|
410
|
+
}
|
411
|
+
}), 'ip link add dev ip6erspan1 name ip6erspan1 type ip6erspan remote fc00:100::1 local fc00:100::1 erspan_ver 2 erspan 1 erspan_dir ingress erspan_hwid 17 allow-localremote')
|
412
|
+
|
413
|
+
expect_command(host.ip(object_variant, action_variant, {
|
414
|
+
dev: 'ip6erspan2',
|
415
|
+
name: 'ip6erspan2',
|
416
|
+
type: 'ip6erspan',
|
417
|
+
type_opts: {
|
418
|
+
remote: 'fc00:100::1',
|
419
|
+
local: 'fc00:100::1',
|
420
|
+
allow_localremote: false
|
421
|
+
}
|
422
|
+
}), 'ip link add dev ip6erspan2 name ip6erspan2 type ip6erspan remote fc00:100::1 local fc00:100::1 noallow-localremote')
|
423
|
+
|
424
|
+
expect_command(host.ip(object_variant, action_variant, {
|
425
|
+
dev: 'ip6erspan3',
|
426
|
+
name: 'ip6erspan3',
|
427
|
+
type: 'ip6erspan',
|
428
|
+
type_opts: {
|
429
|
+
external: true
|
430
|
+
}
|
431
|
+
}), 'ip link add dev ip6erspan3 name ip6erspan3 type ip6erspan external')
|
432
|
+
end
|
433
|
+
|
434
|
+
it "prepares #{action_variant} command with geneve" do
|
435
|
+
expect_command(host.ip(object_variant, action_variant, {
|
436
|
+
dev: 'eth0',
|
437
|
+
name: 'geneve0',
|
438
|
+
type: 'geneve',
|
439
|
+
type_opts: {
|
440
|
+
external: true
|
441
|
+
}
|
442
|
+
}), 'ip link add dev eth0 name geneve0 type geneve external')
|
443
|
+
|
444
|
+
expect_command(host.ip(object_variant, action_variant, {
|
445
|
+
dev: 'eth0',
|
446
|
+
name: 'geneve0',
|
447
|
+
type: 'geneve',
|
448
|
+
type_opts: {
|
449
|
+
external: false
|
450
|
+
}
|
451
|
+
}), 'ip link add dev eth0 name geneve0 type geneve noexternal')
|
452
|
+
|
453
|
+
expect_command(host.ip(object_variant, action_variant, {
|
454
|
+
dev: 'eth0',
|
455
|
+
name: 'geneve0',
|
456
|
+
type: 'geneve',
|
457
|
+
type_opts: {
|
458
|
+
id: 1,
|
459
|
+
remote: '172.0.0.1',
|
460
|
+
ttl: 300,
|
461
|
+
tos: '0x28',
|
462
|
+
df: 'unset',
|
463
|
+
flowlabel: 'geneve-flow-label',
|
464
|
+
dstport: 6082,
|
465
|
+
udpcsum: true,
|
466
|
+
udp6zerocsumtx: true,
|
467
|
+
udp6zerocsumrx: true
|
468
|
+
}
|
469
|
+
}), 'ip link add dev eth0 name geneve0 type geneve id 1 remote 172.0.0.1 ttl 300 tos 0x28 df unset flowlabel geneve-flow-label dstport 6082 udpcsum udp6zerocsumtx udp6zerocsumrx')
|
470
|
+
|
471
|
+
expect_command(host.ip(object_variant, action_variant, {
|
472
|
+
dev: 'eth0',
|
473
|
+
name: 'geneve0',
|
474
|
+
type: 'geneve',
|
475
|
+
type_opts: {
|
476
|
+
id: 1,
|
477
|
+
remote: '172.0.0.1',
|
478
|
+
ttl: 300,
|
479
|
+
tos: '0x28',
|
480
|
+
df: 'unset',
|
481
|
+
flowlabel: 'geneve-flow-label',
|
482
|
+
dstport: 6082,
|
483
|
+
udpcsum: false,
|
484
|
+
udp6zerocsumtx: false,
|
485
|
+
udp6zerocsumrx: false
|
486
|
+
}
|
487
|
+
}), 'ip link add dev eth0 name geneve0 type geneve id 1 remote 172.0.0.1 ttl 300 tos 0x28 df unset flowlabel geneve-flow-label dstport 6082 noudpcsum noudp6zerocsumtx noudp6zerocsumrx')
|
488
|
+
end
|
489
|
+
|
490
|
+
it "prepares #{action_variant} command with bareudp" do
|
491
|
+
expect_command(host.ip(object_variant, action_variant, {
|
492
|
+
dev: 'bareudp0',
|
493
|
+
name: 'bareudp0',
|
494
|
+
type: 'bareudp',
|
495
|
+
type_opts: {
|
496
|
+
dstport: 6635,
|
497
|
+
ethertype: 'mpls_uc',
|
498
|
+
srcportmin: 100,
|
499
|
+
multiproto: true
|
500
|
+
}
|
501
|
+
}), 'ip link add dev bareudp0 name bareudp0 type bareudp dstport 6635 ethertype mpls_uc srcportmin 100 multiproto')
|
502
|
+
end
|
503
|
+
|
504
|
+
%w[macvlan macvtap].each do |type|
|
505
|
+
it "prepares #{action_variant} command with #{type}" do
|
506
|
+
expect_command(host.ip(object_variant, action_variant, {
|
507
|
+
dev: 'bareudp0',
|
508
|
+
name: 'bareudp0',
|
509
|
+
type: type,
|
510
|
+
type_opts: {
|
511
|
+
mode: 'bridge'
|
512
|
+
}
|
513
|
+
}), "ip link add dev bareudp0 name bareudp0 type #{type} mode bridge")
|
514
|
+
end
|
515
|
+
end
|
516
|
+
|
517
|
+
it "prepares #{action_variant} command with hsr" do
|
518
|
+
expect_command(host.ip(object_variant, action_variant, {
|
519
|
+
dev: 'hsr1',
|
520
|
+
name: 'hsr1',
|
521
|
+
type: 'hsr',
|
522
|
+
type_opts: {
|
523
|
+
slave1: 'eth1',
|
524
|
+
slave2: 'eth2',
|
525
|
+
supervision: '254',
|
526
|
+
version: '1',
|
527
|
+
proto: '1'
|
528
|
+
}
|
529
|
+
}), 'ip link add dev hsr1 name hsr1 type hsr slave1 eth1 slave2 eth2 supervision 254 version 1 proto 1')
|
530
|
+
end
|
531
|
+
|
532
|
+
it "prepares #{action_variant} command with bridge" do
|
533
|
+
expect_command(host.ip(object_variant, action_variant, {
|
534
|
+
dev: 'br0',
|
535
|
+
name: 'br0',
|
536
|
+
type: 'bridge',
|
537
|
+
type_opts: {
|
538
|
+
ageing_time: 29_999,
|
539
|
+
group_fwd_mask: 0,
|
540
|
+
group_address: '01:80:c2:00:00:00',
|
541
|
+
forward_delay: 0,
|
542
|
+
hello_time: 199,
|
543
|
+
max_age: 1999,
|
544
|
+
stp_state: 0,
|
545
|
+
priority: 32_768,
|
546
|
+
vlan_filtering: 0,
|
547
|
+
vlan_protocol: '802.1Q',
|
548
|
+
vlan_default_pvid: 1,
|
549
|
+
vlan_stats_enabled: 1,
|
550
|
+
vlan_stats_per_port: 1,
|
551
|
+
mcast_snooping: 1,
|
552
|
+
mcast_router: 1,
|
553
|
+
mcast_query_use_ifaddr: 0,
|
554
|
+
mcast_querier: 0,
|
555
|
+
mcast_hash_elasticity: 4,
|
556
|
+
mcast_hash_max: 512,
|
557
|
+
mcast_last_member_count: 2,
|
558
|
+
mcast_startup_query_count: 2,
|
559
|
+
mcast_last_member_interval: 99,
|
560
|
+
mcast_membership_interval: 25_999,
|
561
|
+
mcast_querier_interval: 25_499,
|
562
|
+
mcast_query_interval: 12_499,
|
563
|
+
mcast_query_response_interval: 999,
|
564
|
+
mcast_startup_query_interval: 3124,
|
565
|
+
mcast_stats_enabled: 0,
|
566
|
+
mcast_igmp_version: 2,
|
567
|
+
mcast_mld_version: 1,
|
568
|
+
nf_call_iptables: 0,
|
569
|
+
nf_call_ip6tables: 0,
|
570
|
+
nf_call_arptables: 0
|
571
|
+
}
|
572
|
+
}), 'ip link add dev br0 name br0 type bridge ageing_time 29999 group_fwd_mask 0 group_address 01:80:c2:00:00:00 forward_delay 0 hello_time 199 max_age 1999 stp_state 0 priority 32768 vlan_filtering 0 vlan_protocol 802.1Q vlan_default_pvid 1 vlan_stats_enabled 1 vlan_stats_per_port 1 mcast_snooping 1 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_querier_interval 25499 mcast_hash_elasticity 4 mcast_hash_max 512 mcast_last_member_count 2 mcast_last_member_interval 99 mcast_startup_query_count 2 mcast_startup_query_interval 3124 mcast_query_interval 12499 mcast_query_response_interval 999 mcast_membership_interval 25999 mcast_stats_enabled 0 mcast_igmp_version 2 mcast_mld_version 1 nf_call_iptables 0 nf_call_ip6tables 0 nf_call_arptables 0')
|
573
|
+
end
|
574
|
+
|
575
|
+
it "prepares #{action_variant} command with macsec" do
|
576
|
+
expect_command(host.ip(object_variant, action_variant, {
|
577
|
+
dev: 'eth0',
|
578
|
+
name: 'macsec0',
|
579
|
+
type: 'macsec',
|
580
|
+
type_opts: {
|
581
|
+
address: '32:53:41:bd:7c:27',
|
582
|
+
port: 11,
|
583
|
+
send_sci: 'on',
|
584
|
+
sci: '1',
|
585
|
+
cipher: 'GCM-AES-128',
|
586
|
+
icvlen: 16,
|
587
|
+
encrypt: 'on',
|
588
|
+
end_station: 'on',
|
589
|
+
scb: 'on',
|
590
|
+
protect: 'on',
|
591
|
+
replay: 'on',
|
592
|
+
window: 1,
|
593
|
+
validate: 'check',
|
594
|
+
encodingsa: '3'
|
595
|
+
}
|
596
|
+
}), 'ip link add dev eth0 name macsec0 type macsec address 32:53:41:bd:7c:27 port 11 sci 1 cipher GCM-AES-128 icvlen 16 encrypt on send_sci on end_station on scb on protect on replay on window 1 validate check encodingsa 3')
|
597
|
+
end
|
598
|
+
|
599
|
+
it "prepares #{action_variant} command with vrf" do
|
600
|
+
expect_command(host.ip(object_variant, action_variant, {
|
601
|
+
dev: 'vrf1',
|
602
|
+
name: 'vrf1',
|
603
|
+
type: 'vrf',
|
604
|
+
type_opts: {
|
605
|
+
table: 10
|
606
|
+
}
|
607
|
+
}), 'ip link add dev vrf1 name vrf1 type vrf table 10')
|
608
|
+
end
|
609
|
+
|
610
|
+
it "prepares #{action_variant} command with rmnet" do
|
611
|
+
expect_command(host.ip(object_variant, action_variant, {
|
612
|
+
dev: 'rmnet0',
|
613
|
+
name: 'rmnet0',
|
614
|
+
type: 'rmnet',
|
615
|
+
type_opts: {
|
616
|
+
mux_id: 254
|
617
|
+
}
|
618
|
+
}), 'ip link add dev rmnet0 name rmnet0 type rmnet mux_id 254')
|
619
|
+
end
|
620
|
+
|
621
|
+
it "prepares #{action_variant} command with xfrm" do
|
622
|
+
expect_command(host.ip(object_variant, action_variant, {
|
623
|
+
name: 'xfrm3',
|
624
|
+
type: 'xfrm',
|
625
|
+
type_opts: {
|
626
|
+
dev: 'xfrm3',
|
627
|
+
if_id: 0
|
628
|
+
}
|
629
|
+
}), 'ip link add name xfrm3 type xfrm if_id 0')
|
630
|
+
end
|
631
|
+
end
|
632
|
+
|
633
|
+
it 'prepares set command' do
|
634
|
+
expect_command(host.ip(object_variant, 'set', {
|
635
|
+
dev: 'eth10.10',
|
636
|
+
direction: 'down'
|
637
|
+
}), 'ip link set dev eth10.10 down')
|
638
|
+
|
639
|
+
expect_command(host.ip(object_variant, 'set', {
|
640
|
+
dev: 'eno1.10',
|
641
|
+
mtu: 1400,
|
642
|
+
direction: 'up',
|
643
|
+
arp: 'on',
|
644
|
+
multicast: 'on',
|
645
|
+
allmulticast: 'on',
|
646
|
+
promisc: 'on',
|
647
|
+
trailers: 'on',
|
648
|
+
protodown: 'on',
|
649
|
+
protodown_reason: 30,
|
650
|
+
dynamic: 'on',
|
651
|
+
name: 'eno1-vlan.10',
|
652
|
+
txqueuelen: 256,
|
653
|
+
txqlen: 4,
|
654
|
+
master: 'eno1',
|
655
|
+
address: '172.16.0.2',
|
656
|
+
broadcast: 'ff:ff:ff:ff:ff:ff',
|
657
|
+
brd: 'ff:ff:ff:ff:ff:ff',
|
658
|
+
peer: 'ae:14:7e:e4:6c:64',
|
659
|
+
netns: 1154,
|
660
|
+
alias: 'eno1-alias',
|
661
|
+
group: 0
|
662
|
+
}), 'ip link set dev eno1.10 group 0 up arp on multicast on allmulticast on promisc on protodown on protodown_reason 30 dynamic on name eno1-vlan.10 txqueuelen 256 txqlen 4 mtu 1400 address 172.16.0.2 broadcast ff:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff peer ae:14:7e:e4:6c:64 netns 1154 alias eno1-alias master eno1')
|
663
|
+
|
664
|
+
expect_command(host.ip(object_variant, 'set', {
|
665
|
+
dev: 'eno1.10',
|
666
|
+
master: false
|
667
|
+
}), 'ip link set dev eno1.10 nomaster')
|
668
|
+
|
669
|
+
expect do
|
670
|
+
host.ip(object_variant, 'set')
|
671
|
+
end.to raise_error(ArgumentError)
|
672
|
+
end
|
673
|
+
|
674
|
+
it 'prepares set command with vf' do
|
675
|
+
expect_command(host.ip(object_variant, 'set', {
|
676
|
+
dev: 'eth0',
|
677
|
+
vf: 5,
|
678
|
+
mac: 'AD:D9:01:ED:0B:13',
|
679
|
+
vlan: 10,
|
680
|
+
qos: 1,
|
681
|
+
proto: '802.1ad',
|
682
|
+
rate: 0,
|
683
|
+
max_tx_rate: 0,
|
684
|
+
min_tx_rate: 0,
|
685
|
+
spoofchk: 'on',
|
686
|
+
query_rss: 'on',
|
687
|
+
state: 'enable',
|
688
|
+
trust: 'on',
|
689
|
+
node_guid: 100,
|
690
|
+
port_guid: 100
|
691
|
+
}), 'ip link set dev eth0 vf 5 mac AD:D9:01:ED:0B:13 vlan 10 qos 1 proto 802.1ad rate 0 max_tx_rate 0 min_tx_rate 0 spoofchk on query_rss on state enable trust on node_guid 100 port_guid 100')
|
692
|
+
end
|
693
|
+
|
694
|
+
it 'prepares set command with xdp' do
|
695
|
+
expect_command(host.ip(object_variant, 'set', {
|
696
|
+
dev: 'vethcaf7146',
|
697
|
+
xdp: 'object',
|
698
|
+
object: 'udp.o',
|
699
|
+
section: 'dropper_main',
|
700
|
+
verbose: true
|
701
|
+
}), 'ip link set dev vethcaf7146 xdp object udp.o section dropper_main verbose')
|
702
|
+
|
703
|
+
expect_command(host.ip(object_variant, 'set', {
|
704
|
+
dev: 'vethcaf7146',
|
705
|
+
xdp: 'pinned',
|
706
|
+
pinned: 'udp.o'
|
707
|
+
}), 'ip link set dev vethcaf7146 xdp pinned udp.o')
|
708
|
+
|
709
|
+
expect_command(host.ip(object_variant, 'set', {
|
710
|
+
dev: 'vethcaf7146',
|
711
|
+
xdp: 'off'
|
712
|
+
}), 'ip link set dev vethcaf7146 xdp off')
|
713
|
+
end
|
714
|
+
|
715
|
+
it 'prepares set command with type opts' do
|
716
|
+
expect do
|
717
|
+
host.ip(object_variant, 'set', {
|
718
|
+
dev: 'eno10.10',
|
719
|
+
type: 'bridge_'
|
720
|
+
})
|
721
|
+
end.to raise_error(ArgumentError)
|
722
|
+
|
723
|
+
expect_command(host.ip(object_variant, 'set', {
|
724
|
+
dev: 'eth0bridge',
|
725
|
+
type: 'bridge_slave',
|
726
|
+
type_opts: {
|
727
|
+
fdb_flush: true,
|
728
|
+
state: 1,
|
729
|
+
priority: 63,
|
730
|
+
cost: 1,
|
731
|
+
guard: 'on',
|
732
|
+
hairpin: 'off',
|
733
|
+
fastleave: 'off',
|
734
|
+
root_block: 'on',
|
735
|
+
learning: 'on',
|
736
|
+
flood: 'on',
|
737
|
+
proxy_arp: 'on',
|
738
|
+
proxy_arp_wifi: 'off',
|
739
|
+
mcast_router: 3,
|
740
|
+
mcast_fast_leave: 'on',
|
741
|
+
mcast_flood: 'on',
|
742
|
+
mcast_to_unicast: 'off',
|
743
|
+
group_fwd_mask: 0,
|
744
|
+
neigh_suppress: 'on',
|
745
|
+
vlan_tunnel: 'on',
|
746
|
+
backup_port: 'eth0backup'
|
747
|
+
}
|
748
|
+
}), 'ip link set dev eth0bridge type bridge_slave fdb_flush state 1 priority 63 cost 1 guard on hairpin off fastleave off root_block on learning on flood on proxy_arp on proxy_arp_wifi off mcast_router 3 mcast_fast_leave on mcast_flood on mcast_to_unicast off group_fwd_mask 0 neigh_suppress on neigh_suppress on backup_port eth0backup')
|
749
|
+
|
750
|
+
expect_command(host.ip(object_variant, 'set', {
|
751
|
+
dev: 'eth0bridge',
|
752
|
+
type: 'bridge_slave',
|
753
|
+
type_opts: {
|
754
|
+
nobackup_port: true
|
755
|
+
}
|
756
|
+
}), 'ip link set dev eth0bridge type bridge_slave nobackup_port')
|
757
|
+
|
758
|
+
expect_command(host.ip(object_variant, 'set', {
|
759
|
+
dev: 'eth0bond',
|
760
|
+
type: 'bond_slave',
|
761
|
+
type_opts: {
|
762
|
+
queue_id: 1
|
763
|
+
}
|
764
|
+
}), 'ip link set dev eth0bond type bond_slave queue_id 1')
|
765
|
+
|
766
|
+
expect_command(host.ip(object_variant, 'set', {
|
767
|
+
dev: 'eth1macvlan',
|
768
|
+
type: 'macvlan',
|
769
|
+
type_opts: {
|
770
|
+
mode: 'bridge',
|
771
|
+
flag: 'nopromisc',
|
772
|
+
mode_opts: 'add',
|
773
|
+
mac_address: '19:18:4F:92:5E:CD'
|
774
|
+
}
|
775
|
+
}), 'ip link set dev eth1macvlan type macvlan mode bridge flag nopromisc add 19:18:4F:92:5E:CD')
|
776
|
+
|
777
|
+
expect_command(host.ip(object_variant, 'set', {
|
778
|
+
dev: 'eth1macvlan',
|
779
|
+
type: 'macvlan',
|
780
|
+
type_opts: {
|
781
|
+
mode_opts: 'del',
|
782
|
+
mac_address: '19:18:4F:92:5E:CD'
|
783
|
+
}
|
784
|
+
}), 'ip link set dev eth1macvlan type macvlan del 19:18:4F:92:5E:CD')
|
785
|
+
|
786
|
+
expect_command(host.ip(object_variant, 'set', {
|
787
|
+
dev: 'eth1macvlan',
|
788
|
+
type: 'macvlan',
|
789
|
+
type_opts: {
|
790
|
+
mode_opts: 'set',
|
791
|
+
mac_address: '07:88:8C:11:C3:80'
|
792
|
+
}
|
793
|
+
}), 'ip link set dev eth1macvlan type macvlan set 07:88:8C:11:C3:80')
|
794
|
+
|
795
|
+
expect_command(host.ip(object_variant, 'set', {
|
796
|
+
dev: 'eth1macvlan',
|
797
|
+
type: 'macvtap',
|
798
|
+
type_opts: {
|
799
|
+
mode_opts: 'set',
|
800
|
+
mac_address: ['0D:42:6D:3E:22:B8', '7F:3D:FC:AF:A3:F3']
|
801
|
+
}
|
802
|
+
}), 'ip link set dev eth1macvlan type macvtap set 0D:42:6D:3E:22:B8 7F:3D:FC:AF:A3:F3')
|
803
|
+
|
804
|
+
expect_command(host.ip(object_variant, 'set', {
|
805
|
+
dev: 'eth1macvlan',
|
806
|
+
type: 'macvlan',
|
807
|
+
type_opts: {
|
808
|
+
mode_opts: 'flush'
|
809
|
+
}
|
810
|
+
}), 'ip link set dev eth1macvlan type macvlan flush')
|
811
|
+
end
|
812
|
+
end
|
813
|
+
end
|
814
|
+
end
|