Skip to content

Commit

Permalink
Merge pull request #54 from vmware/dev
Browse files Browse the repository at this point in the history
Fix error codes for install existing, update-check. Add tests
  • Loading branch information
ppadmavilasom committed Jan 15, 2016
2 parents 3c47a3c + 2aea2fc commit 7b9d76c
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 2 deletions.
4 changes: 4 additions & 0 deletions client/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ TDNFCheckUpdates(
ppszPackageNameSpecs,
ppPkgInfo,
pdwCount);
if(dwError == ERROR_TDNF_NO_MATCH)
{
dwError = 0;
}

cleanup:
return dwError;
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT(tdnf, 1.0.6)
AC_INIT(tdnf, 1.0.7)
AC_MSG_NOTICE([tdnf configuration])

AC_CANONICAL_SYSTEM
Expand Down
10 changes: 10 additions & 0 deletions tests/install.at
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ TDNF_CLI_W_CHROOT install tdnf-test-one -y
[ignore])
AT_CLEANUP

AT_SETUP([install existing])
AT_KEYWORDS([install])
AT_CHECK([
TDNF_CLI_W_CHROOT install tdnf-test-one -y
],
[0],
[ignore],
[ignore])
AT_CLEANUP

AT_SETUP([install non existent])
AT_KEYWORDS([install])
AT_CHECK([
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite.at
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ m4_include([version.at])
m4_include([list.at])
m4_include([install.at])
m4_include([erase.at])
m4_include([update.at])
32 changes: 32 additions & 0 deletions tests/update.at
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Copyright (C) 2015 VMware, Inc. All Rights Reserved.
#
# Licensed under the GNU Lesser General Public License v2.1 (the "License");
# you may not use this file except in compliance with the License. The terms
# of the License are located in the COPYING file of this distribution.
#

AT_BANNER(tdnf update tests)

AT_SETUP([update check])
AT_KEYWORDS([update])
AT_CHECK([
TDNF_CHROOT_CLEAN
TDNF_CHROOT_INIT
TDNF_BUILD_INSTALL_RPMS
TDNF_CLI_W_CHROOT check-update
],
[0],
[ignore],
[ignore])
AT_CLEANUP

AT_SETUP([update all])
AT_KEYWORDS([update])
AT_CHECK([
TDNF_CLI_W_CHROOT update -y
],
[0],
[ignore],
[ignore])
AT_CLEANUP
3 changes: 2 additions & 1 deletion tools/cli/installcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ TDNFCliAlterCommand(
{
dwError = ERROR_TDNF_CLI_NOTHING_TO_DO;
//If there are unresolved, error with no match
if(pSolvedPkgInfo->ppszPkgsNotResolved)
if(pSolvedPkgInfo->ppszPkgsNotResolved &&
*pSolvedPkgInfo->ppszPkgsNotResolved)
{
dwError = ERROR_TDNF_NO_MATCH;
}
Expand Down

0 comments on commit 7b9d76c

Please sign in to comment.