https://bugzilla.redhat.com/show_bug.cgi?id=817821 (Red Hat Enterprise Linux 6)
Description of problem: ipa config-mod --delattr returns misleading/invalid error messages with the following negative tests :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: ipaconfig_delattr invalid attribute negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: Executing: ipa config-mod --delattr=ipaCustomFields=FALSE :: [ LOG ] :: "ipa config-mod --delattr=ipaCustomFields=FALSE" failed as expected. :: [ FAIL ] :: ERROR: Message not as expected. GOT: ipa: ERROR: ipacustomfields does not contain 'FALSE' EXP: ipa: ERROR: 'ipacustomfields' does not exist :: [ FAIL ] :: Verify expected error message. (Expected 0, got 1) :: [ LOG ] :: Duration: 5s :: [ LOG ] :: Assertions: 0 good, 2 bad :: [ FAIL ] :: RESULT: ipaconfig_delattr invalid attribute negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: ipaconfig_mod_delattr ipahomesrootdir negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: Executing: ipa config-mod --delattr=ipahomesrootdir=/home/ :: [ LOG ] :: "ipa config-mod --delattr=ipahomesrootdir=/home/" failed as expected. :: [ FAIL ] :: ERROR: Message not as expected. GOT: ipa: ERROR: ipahomesrootdir does not contain '/home/' EXP: ipa: ERROR: 'ipahomesrootdir' is required :: [ FAIL ] :: Verify expected error message. (Expected 0, got 1) :: [ LOG ] :: Duration: 5s :: [ LOG ] :: Assertions: 0 good, 2 bad :: [ FAIL ] :: RESULT: ipaconfig_mod_delattr ipahomesrootdir negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: ipaconfig_mod_delattr ipadefaultloginshell negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: Executing: ipa config-mod --delattr=ipadefaultloginshell=/bin/bash :: [ LOG ] :: "ipa config-mod --delattr=ipadefaultloginshell=/bin/bash" failed as expected. :: [ FAIL ] :: ERROR: Message not as expected. GOT: ipa: ERROR: ipadefaultloginshell does not contain '/bin/bash' EXP: ipa: ERROR: 'ipadefaultloginshell' is required :: [ FAIL ] :: Verify expected error message. (Expected 0, got 1) :: [ LOG ] :: Duration: 5s :: [ LOG ] :: Assertions: 0 good, 2 bad :: [ FAIL ] :: RESULT: ipaconfig_mod_delattr ipadefaultloginshell negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: ipaconfig_mod_delattr ipadefaultprimarygroup negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: Executing: ipa config-mod --delattr=ipadefaultprimarygroup=cn=ipausers,cn=accounts,cn=dc=testrelm,dc=com :: [ LOG ] :: "ipa config-mod --delattr=ipadefaultprimarygroup=cn=ipausers,cn=accounts,cn=dc=testrelm,dc=com" failed as expected. :: [ FAIL ] :: ERROR: Message not as expected. GOT: ipa: ERROR: ipadefaultprimarygroup does not contain 'cn=ipausers,cn=accounts,cn=dc=testrelm,dc=com' EXP: ipa: ERROR: 'ipadefaultprimarygroup' is required :: [ FAIL ] :: Verify expected error message. (Expected 0, got 1) :: [ LOG ] :: Duration: 5s :: [ LOG ] :: Assertions: 0 good, 2 bad :: [ FAIL ] :: RESULT: ipaconfig_mod_delattr ipadefaultprimarygroup negative test Version-Release number of selected component (if applicable): ipa-server-2.2.0-11.el6.i686 How reproducible: always Steps to Reproduce: 1. see description 2. 3. Actual results: ipa: ERROR: <ipaconfigattr> does not contain '<currentvalueofconfigattr>' Expected results: ipa: ERROR: '<ipaconfigattr>' is required Additional info: The following config attributes return the correct error messages :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: ipaconfig_mod_delattr ipasearchtimelimit negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: Executing: ipa config-mod --delattr=ipasearchtimelimit=2 :: [ LOG ] :: "ipa config-mod --delattr=ipasearchtimelimit=2" failed as expected. :: [ PASS ] :: Error message as expected: ipa: ERROR: 'ipasearchtimelimit' is required :: [ PASS ] :: Verify expected error message. :: [ LOG ] :: Duration: 6s :: [ LOG ] :: Assertions: 2 good, 0 bad :: [ PASS ] :: RESULT: ipaconfig_mod_delattr ipasearchtimelimit negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: ipaconfig_mod_delattr ipasearchrecordslimit negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: Executing: ipa config-mod --delattr=ipasearchrecordslimit=100 :: [ LOG ] :: "ipa config-mod --delattr=ipasearchrecordslimit=100" failed as expected. :: [ PASS ] :: Error message as expected: ipa: ERROR: 'ipasearchrecordslimit' is required :: [ PASS ] :: Verify expected error message. :: [ LOG ] :: Duration: 6s :: [ LOG ] :: Assertions: 2 good, 0 bad :: [ PASS ] :: RESULT: ipaconfig_mod_delattr ipasearchrecordslimit negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: ipaconfig_mod_delattr ipacertificatesubjectbase negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: Executing: ipa config-mod --delattr=ipacertificatesubjectbase=O=TESTRELM.COM :: [ LOG ] :: "ipa config-mod --delattr=ipacertificatesubjectbase=O=TESTRELM.COM" failed as expected. :: [ PASS ] :: Error message as expected: ipa: ERROR: 'ipacertificatesubjectbase' is required :: [ PASS ] :: Verify expected error message. :: [ LOG ] :: Duration: 6s :: [ LOG ] :: Assertions: 2 good, 0 bad :: [ PASS ] :: RESULT: ipaconfig_mod_delattr ipacertificatesubjectbase negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: ipaconfig_mod_delattr ipapwdexpadvnotify negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: Executing: ipa config-mod --delattr=ipapwdexpadvnotify=4 :: [ LOG ] :: "ipa config-mod --delattr=ipapwdexpadvnotify=4" failed as expected. :: [ PASS ] :: Error message as expected: ipa: ERROR: 'ipapwdexpadvnotify' is required :: [ PASS ] :: Verify expected error message. :: [ LOG ] :: Duration: 6s :: [ LOG ] :: Assertions: 2 good, 0 bad :: [ PASS ] :: RESULT: ipaconfig_mod_delattr ipapwdexpadvnotify negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: ipaconfig_mod_delattr ipamaxusernamelength negative test ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : :: [ LOG ] :: Executing: ipa config-mod --delattr=ipamaxusernamelength=32 :: [ LOG ] :: "ipa config-mod --delattr=ipamaxusernamelength=32" failed as expected. :: [ PASS ] :: Error message as expected: ipa: ERROR: 'ipamaxusernamelength' is required :: [ PASS ] :: Verify expected error message. :: [ LOG ] :: Duration: 5s :: [ LOG ] :: Assertions: 2 good, 0 bad :: [ PASS ] :: RESULT: ipaconfig_mod_delattr ipamaxusernamelength negative test
In this case:
ipa config-mod --delattr=ipaCustomFields=FALSE
the default is empty, so yes, it would be better to say "X does not exist". Same with:
ipa config-mod --delattr=bogusattribute=FALSE
where the attribute doesn't exist at all.
But here:
ipa config-mod --delattr=ipahomesrootdir=/home/ ipa config-mod --delattr=ipadefaultloginshell=/bin/bash ipa config-mod --delattr=ipadefaultprimarygroup=cn=ipausers,cn=accounts,cn=dc=testrelm,dc=com
the default values are "/home", "/bin/sh" and "ipausers", respectively, so the "X does not contain Y" message is entirely appropriate (assuming you did not change the defaults).
Only when you try to delete an existing value does the validator for required fields kick in.
I'll take this one
master: 51bd68e
Metadata Update from @rcritten: - Issue assigned to pviktori - Issue set to the milestone: FreeIPA 3.0 Core Effort - 2012/05
Login to comment on this ticket.