cmd: fix regression with ifdown -f handling

Alpine #11887
This commit is contained in:
Ariadne Conill 2020-08-24 02:19:01 -06:00
parent 90ba72efe2
commit 72ad50213f
2 changed files with 8 additions and 2 deletions

View file

@ -74,7 +74,7 @@ no_op(const char *opt_arg)
}
static struct if_option exec_options[] = {
{'f', "force", NULL, "force (de)configuration", true, no_op},
{'f', "force", NULL, "force (de)configuration", false, no_op},
{'i', "interfaces", "interfaces FILE", "use FILE for interface definitions", true, set_interfaces_file},
{'l', "no-lock", NULL, "do not use a lockfile to serialize state changes", false, set_no_lock},
{'n', "no-act", NULL, "do not actually run any commands", false, set_no_act},

View file

@ -18,7 +18,8 @@ tests_init \
learned_dependency \
learned_dependency_2 \
learned_executor \
implicit_vlan
implicit_vlan \
regress_opt_f
noargs_body() {
atf_check -s exit:1 -e ignore ifdown -S/dev/null
@ -140,3 +141,8 @@ implicit_vlan_body() {
-e match:"attempting to run link executor" \
ifdown -n -S $FIXTURES/vlan.ifstate -E $EXECUTORS -i $FIXTURES/vlan.interfaces eth0.8
}
regress_opt_f_body() {
atf_check -s exit:0 -o ignore -e ignore \
ifdown -n -S $FIXTURES/vlan.ifstate -E $EXECUTORS -i $FIXTURES/vlan.interfaces -f eth0.8
}