apt-key del: Ignore case when checking if a keyid exists in a keyring.
[ntk/apt.git] / test / integration / test-apt-key
index 47230cb..437212a 100755 (executable)
@@ -38,6 +38,12 @@ testsuccess --nomsg aptkey --fakeroot update
 aptkey list | grep '^pub' > aptkey.list
 testfileequal ./aptkey.list 'pub   2048R/DBAC8DAE 2010-08-18'
 
+msgtest "Try to remove a" 'nonexistent keyid'
+testfailure --nomsg aptkey --fakeroot --keyring rootdir/etc/apt/trusted.gpg del BOGUSKEY
+
+aptkey list | grep '^pub' > aptkey2.list
+testsuccess diff ./aptkey.list ./aptkey2.list
+
 msgtest "Try to remove a key which exists, but isn't in the" 'forced keyring'
 testsuccess --nomsg aptkey --fakeroot --keyring rootdir/etc/apt/trusted.gpg del DBAC8DAE
 
@@ -61,6 +67,14 @@ testempty aptkey list
 testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
 
+msgtest 'Test key removal with' 'lowercase keyid'
+cleanplate
+cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+testsuccess --nomsg aptkey --fakeroot del dbac8dae
+testempty aptkey list
+testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
+
 msgtest 'Test key removal with' 'single key in softlink'
 cleanplate
 ln -s $(readlink -f ./keys/joesixpack.pub) rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg