Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History tests #248

Merged
merged 6 commits into from
Oct 19, 2017
Merged

History tests #248

merged 6 commits into from
Oct 19, 2017

Conversation

edcuba
Copy link
Contributor

@edcuba edcuba commented Feb 8, 2017

Added some tests for dnf history undo and redo

@@ -263,3 +263,21 @@ def then_the_section(context, section, pkgs):
return
except StopIteration:
raise AssertionError('section {} has not been found'.format(section))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, nothing in test_behave. it's deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I didn't know that. Will fix it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fine for now... I will probably add some more this week.

@@ -0,0 +1,21 @@
from behave import then
from behave import when
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[flake8]

  • [F401] 'when' imported but unused

@@ -0,0 +1,21 @@
from behave import then
from behave import when
from behave import given
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[flake8]

  • [F401] 'given' imported but unused

@edcuba edcuba force-pushed the master branch 2 times, most recently from 980ad00 to d4faec9 Compare February 14, 2017 11:10
Feature: DNF/Behave test Transaction history - base

Scenario: Simple transaction
Given I use the repository "test-1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is deprecated


Scenario: Simple transaction
Given I use the repository "test-1"
When I execute "dnf" command "install -y TestA" with "success"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is deprecated

Copy link
Contributor Author

@edcuba edcuba Feb 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any alternatives for these two? Or should I write new ones?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is, check obsoletes-reason for example

@edcuba edcuba force-pushed the master branch 4 times, most recently from 4941cfd to 9fb473c Compare February 16, 2017 18:41
@edcuba
Copy link
Contributor Author

edcuba commented Feb 16, 2017

Should be fine now

Scenario: Update packages
When I save rpmdb
And I successfully run "dnf install -y TestA TestB TestD"
When I save rpmdb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should first check if all those packages have been installed correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

| removed | TestA, TestB |
And history should contain "history undo last -y" with action "Erase" and "2" packages

Scenario: Undo transaction last 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is Undo last transaction 2 better? 😄

@edcuba
Copy link
Contributor Author

edcuba commented Mar 9, 2017

History tests should be complete now.

Edit: added obsoletes-keep-reason here, test is dependent on history steps

@edcuba
Copy link
Contributor Author

edcuba commented Mar 16, 2017

fixed indentation

@edcuba
Copy link
Contributor Author

edcuba commented May 12, 2017

Then history info is broken in upstream

      shell.command.stderr:
      AttributeError: 'list' object has no attribute 'add'

I have the same output in rawhide docker image

[xcubae00@ares ~]$ docker run -it --rm fedora:rawhide bash
[root@40ff792a3361 /]# dnf history info
Fedora - Rawhide - Developmental packages for t  11 MB/s |  54 MB     00:04    
Last metadata expiration check: 0:00:20 ago on Fri May 12 07:36:36 2017 UTC.
AttributeError: 'list' object has no attribute 'add'
[root@40ff792a3361 /]# 

Like I said, rpm-software-management/dnf#756 should fix that issue
History tests aren't dependent on SWDB.

@j-mracek
Copy link
Member

j-mracek commented May 17, 2017

@edynox Still one of the step is failing even with your patch:

 Then history info should match                # behave/steps/command_steps.py:166
      | Key          | Value        |
      | Command Line | update -y    |
      | Return-Code  | Success      |
      | Upgrade      | TestA, TestB |
      | Upgraded     | TestA, TestB |
    And history info "last-2..last" should match  # behave/steps/command_steps.py:166
      | Key         | Value        |
      | Return-Code | Success      |
      | Upgrade     | TestA, TestB |
      | Upgraded    | TestA, TestB |
      | Install     | TestA, TestB |
      | Erase       | TestA, TestB |
      Assertion Failed: "TestA" not matched as "Install"
      Captured stdout:
      shell.command: ['dnf-2', 'install', '-y', 'TestA']
      shell.command.stdout:
      Last metadata expiration check: 0:00:04 ago on Wed May 17 11:40:10 2017 UTC.
      Dependencies resolved.
      ================================================================================
       Package           Arch               Version            Repository        Size
      ================================================================================
      Installing:
       TestA             noarch             1-1                test             5.5 k
      Installing dependencies:
       TestB             noarch             1-1                test             5.4 k
      
      Transaction Summary
      ================================================================================
      Install  2 Packages
      
      Total size: 11 k
      Installed size: 0  
      Running transaction check
      Transaction check succeeded.
      Running transaction test
      Transaction test succeeded.
      Running transaction
        Preparing        :                                                        1/1 
        Installing       : TestB-1-1.noarch                                       1/2 
        Installing       : TestA-1-1.noarch                                       2/2 
        Verifying        : TestA-1-1.noarch                                       1/2 
        Verifying        : TestB-1-1.noarch                                       2/2 
      
      Installed:
        TestA.noarch 1-1                       TestB.noarch 1-1                      
      
      Complete!
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'history', 'info']
      shell.command.stdout:
      Last metadata expiration check: 0:00:05 ago on Wed May 17 11:40:10 2017 UTC.
      Transaction ID : 10
      Begin time     : Wed May 17 11:40:15 2017
      Begin rpmdb    : 252:66f6c164c5f498979cdce259868e19d90c855b66
      End time       :                           (0 seconds)
      End rpmdb      : 254:4543a7d0514c0c9f6e516d0b2aff50ed8619d6ab
      User           : System <unset>
      Return-Code    : Success
      Command Line   : install -y TestA
      Transaction performed with:
          Installed     dnf-2.4.2-0.4g139e6e8.fc25.noarch @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.0.1-1.fc25.x86_64        @koji-override-0
      Packages Altered:
          Install TestA-1-1.noarch @test
          Install TestB-1-1.noarch @test
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'update', '-y']
      shell.command.stdout:
      Last metadata expiration check: 0:00:00 ago on Wed May 17 11:40:16 2017 UTC.
      Dependencies resolved.
      ================================================================================
       Package           Arch               Version         Repository           Size
      ================================================================================
      Upgrading:
       TestA             noarch             2-1             updates             5.4 k
       TestB             noarch             2-1             updates             5.4 k
       TestC             noarch             2-1             updates             5.4 k
      
      Transaction Summary
      ================================================================================
      Upgrade  3 Packages
      
      Total size: 16 k
      Running transaction check
      Transaction check succeeded.
      Running transaction test
      Transaction test succeeded.
      Running transaction
        Preparing        :                                                        1/1 
        Upgrading        : TestC-2-1.noarch                                       1/6 
        Upgrading        : TestB-2-1.noarch                                       2/6 
        Upgrading        : TestA-2-1.noarch                                       3/6 
        Cleanup          : TestA-1-1.noarch                                       4/6 
        Cleanup          : TestB-1-1.noarch                                       5/6 
        Cleanup          : TestC-1-1.noarch                                       6/6 
        Verifying        : TestA-2-1.noarch                                       1/6 
        Verifying        : TestB-2-1.noarch                                       2/6 
        Verifying        : TestC-2-1.noarch                                       3/6 
        Verifying        : TestA-1-1.noarch                                       4/6 
        Verifying        : TestB-1-1.noarch                                       5/6 
        Verifying        : TestC-1-1.noarch                                       6/6 
      
      Upgraded:
        TestA.noarch 2-1          TestB.noarch 2-1          TestC.noarch 2-1         
      
      Complete!
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'history', 'info']
      shell.command.stdout:
      Last metadata expiration check: 0:00:01 ago on Wed May 17 11:40:16 2017 UTC.
      Transaction ID : 11
      Begin time     : Wed May 17 11:40:16 2017
      Begin rpmdb    : 254:4543a7d0514c0c9f6e516d0b2aff50ed8619d6ab
      End time       :            11:40:17 2017 (1 seconds)
      End rpmdb      : 254:4780c0c732cdc98c66f4143aac080f52d87a5d8c
      User           : System <unset>
      Return-Code    : Success
      Command Line   : update -y
      Transaction performed with:
          Installed     dnf-2.4.2-0.4g139e6e8.fc25.noarch @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.0.1-1.fc25.x86_64        @koji-override-0
      Packages Altered:
          Upgraded TestA-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestB-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestC-1-1.noarch @test
          Upgrade        2-1.noarch @updates
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'history', 'info', 'last-2..last']
      shell.command.stdout:
      Last metadata expiration check: 0:00:01 ago on Wed May 17 11:40:16 2017 UTC.
      Transaction ID : 9..11
      Begin time     : Wed May 17 11:40:14 2017
      Begin rpmdb    : 254:4543a7d0514c0c9f6e516d0b2aff50ed8619d6ab
      End time       :            11:40:17 2017 (3 seconds)
      End rpmdb      : 254:4780c0c732cdc98c66f4143aac080f52d87a5d8c
      User           : System <unset>
      Return-Code    : Success
      Command Line   : remove -y TestA
      Command Line   : install -y TestA
      Command Line   : update -y
      Transaction performed with:
          Installed     dnf-2.4.2-0.4g139e6e8.fc25.noarch @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.0.1-1.fc25.x86_64        @koji-override-0
      Packages Altered:
          Upgraded TestA-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestB-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestC-1-1.noarch @test
          Upgrade        2-1.noarch @updates
      
      shell.command.stderr:


@j-mracek j-mracek added the bug label May 17, 2017
@j-mracek
Copy link
Member

@edynox Please can you fix that it will work with upstream version? Then I can merge it. Thanks a lot. Please if there is any problem, just let me know.

@edcuba
Copy link
Contributor Author

edcuba commented May 30, 2017

@j-mracek
I have transaction merging problem in SWDB.
Now I'm rewriting YumMergedHistoryTransaction into libdnf.
DnfSwdbTrans will support merge() method and we can drop both YumMergedHistoryTransaction and YumHistoryTransaction from yum/history.py.

Then upstream and SWDB output should be the same and I will rewrite this test so transaction merging will be tested properly (and passed by both upstream an SWDB)

It is quite lot of work with proper transaction merging so I will need a few days...

@edcuba
Copy link
Contributor Author

edcuba commented Jun 9, 2017

rpm-software-management/libdnf@509f859 introduces transaction merging in SWDB, I will write some tests on it here. YumMergedHistoryTransaction and YumHistoryTransaction were dropped from dnf.

@edcuba
Copy link
Contributor Author

edcuba commented Jun 16, 2017

@j-mracek Merged transactions should be tested properly now. Its working on upstream for me.

@edcuba
Copy link
Contributor Author

edcuba commented Oct 4, 2017

@j-mracek Can you finish the review, please?

@j-mracek
Copy link
Member

j-mracek commented Oct 6, 2017

@edynox I am sorry but I got:

Failed test(s): history-2-dnf-2 history-2-dnf-3

Second time that I repeated it, it passed (same container), and first test output is not reachable.

The reason has be found first.

@j-mracek
Copy link
Member

j-mracek commented Oct 6, 2017

sudo docker run  --rm dnf-bot/dnf-testing:latest launch-test  history-2 dnf-2
+ RESERVE=0
+ '[' history-2 == -r -o history-2 == -R ']'
+ httpd -k start
+ vsftpd
+ rngd -r /dev/urandom -o /dev/random
unable to adjust write_wakeup_threshold: Read-only file system
+ new_name=history-2-dnf-2
+ EXIT_STATUS=0
+ cp /tests/history-2.feature /behave/history-2-dnf-2.feature
+ '[' 0 = 1 ']'
+ TEST_EXIT=0
+ behave-2 --tags '~@backup' --tags '~@restore' -i history-2-dnf-2 -D dnf_cmd=dnf-2 --junit --junit-directory /junit/ /behave/
Feature: DNF/Behave test Transaction history [info, list, userinstalled] # behave/history-2-dnf-2.feature:1

  @setup
  Scenario: Feature Setup                  # behave/history-2-dnf-2.feature:4
    Given repository "test" with packages  # behave/steps/repo_steps.py:254
      | Package | Tag      | Value |
      | TestA   | Requires | TestB |
      | TestB   |          |       |
      | TestC   |          |       |
      | TestD   | Requires | TestE |
      | TestE   | Requires | TestC |
    And repository "updates" with packages # behave/steps/repo_steps.py:254
      | Package | Tag     | Value |
      | TestA   | Version | 2     |
      | TestB   | Version | 2     |
      | TestC   | Version | 2     |
      | TestD   | Version | 2     |
    When I save rpmdb                      # behave/steps/rpm_steps.py:16
    And I enable repository "test"         # behave/steps/repo_steps.py:488

  Scenario: List userinstalled packages                 # behave/history-2-dnf-2.feature:21
    When I save rpmdb                                   # behave/steps/rpm_steps.py:16
    And I successfully run "dnf install -y TestA TestE" # behave/steps/command_steps.py:33
    Then history userinstalled should                   # behave/steps/command_steps.py:174
      | Action    | Packages     |
      | Match     | TestA, TestE |
      | Not match | TestB, TestC |

  Scenario: History list last and range                                                          # behave/history-2-dnf-2.feature:29
    When I save rpmdb                                                                            # behave/steps/rpm_steps.py:16
    And I successfully run "dnf install -y TestD"                                                # behave/steps/command_steps.py:33
    And I successfully run "dnf remove -y TestE"                                                 # behave/steps/command_steps.py:33
    Then history "last-1..last" should match "install -y TestD" with "Install" and "1" package   # behave/steps/command_steps.py:153
    And history "list last-1..last" should match "remove -y TestE" with "Erase" and "3" packages # behave/steps/command_steps.py:153
    And history "last" should match "remove -y TestE" with "Erase" and "3" packages              # behave/steps/command_steps.py:153

  Scenario: History list package                                                          # behave/history-2-dnf-2.feature:37
    When I save rpmdb                                                                     # behave/steps/rpm_steps.py:16
    And I successfully run "dnf install -y TestC"                                         # behave/steps/command_steps.py:33
    Then history "TestC" should match "install -y TestC" with "Install" and "1" package   # behave/steps/command_steps.py:153
    And history "list TestC" should match "remove -y TestE" with "Erase" and "3" packages # behave/steps/command_steps.py:153

  Scenario: History info                          # behave/history-2-dnf-2.feature:43
    When I save rpmdb                             # behave/steps/rpm_steps.py:16
    Then history info should match                # behave/steps/command_steps.py:195
      | Key          | Value            |
      | Command Line | install -y TestC |
      | Return-Code  | Success          |
      | Install      | TestC            |
    When I successfully run "dnf remove -y TestA" # behave/steps/command_steps.py:33
    Then history info should match                # behave/steps/command_steps.py:195
      | Key          | Value           |
      | Command Line | remove -y TestA |
      | Return-Code  | Success         |
      | Erase        | TestA, TestB    |

  Scenario: History info in range - transaction merging  # behave/history-2-dnf-2.feature:57
    When I save rpmdb                                    # behave/steps/rpm_steps.py:16
    And I successfully run "dnf install -y TestA"        # behave/steps/command_steps.py:33
    Then history info should match                       # behave/steps/command_steps.py:195
      | Key          | Value            |
      | Command Line | install -y TestA |
      | Return-Code  | Success          |
      | Install      | TestA, TestB     |
    When I save rpmdb                                    # behave/steps/rpm_steps.py:16
    And I enable repository "updates"                    # behave/steps/repo_steps.py:488
    And I successfully run "dnf update -y"               # behave/steps/command_steps.py:33
    Then history info should match                       # behave/steps/command_steps.py:195
      | Key          | Value        |
      | Command Line | update -y    |
      | Return-Code  | Success      |
      | Upgrade      | TestA, TestB |
      | Upgraded     | TestA, TestB |
    And history info "last-1..last" should match         # behave/steps/command_steps.py:195
      | Key         | Value   |
      | Return-Code | Success |
      | Install     | TestA   |
    And history info "last-2..last" should match         # behave/steps/command_steps.py:195
      | Key         | Value   |
      | Return-Code | Success |
      | Upgrade     | TestA   |
      | Upgraded    | TestA   |
    And history info "last-2..last-1" should match       # behave/steps/command_steps.py:195
      | Key         | Value   |
      | Return-Code | Success |
      | Reinstall   | TestA   |
      Assertion Failed: "TestA" not matched as "Reinstall"
      Captured stdout:
      shell.command: ['dnf-2', 'install', '-y', 'TestA']
      shell.command.stdout:
      Last metadata expiration check: 0:00:05 ago on Fri Oct  6 10:54:13 2017.
      Dependencies resolved.
      ================================================================================
       Package           Arch               Version            Repository        Size
      ================================================================================
      Installing:
       TestA             noarch             1-1                test             5.5 k
      Installing dependencies:
       TestB             noarch             1-1                test             5.4 k
      
      Transaction Summary
      ================================================================================
      Install  2 Packages
      
      Total size: 11 k
      Installed size: 0  
      Downloading Packages:
      Running transaction check
      Transaction check succeeded.
      Running transaction test
      Transaction test succeeded.
      Running transaction
        Preparing        :                                                        1/1 
        Installing       : TestB-1-1.noarch                                       1/2 
        Installing       : TestA-1-1.noarch                                       2/2 
        Verifying        : TestA-1-1.noarch                                       1/2 
        Verifying        : TestB-1-1.noarch                                       2/2 
      
      Installed:
        TestA.noarch 1-1                       TestB.noarch 1-1                      
      
      Complete!
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'history', 'info']
      shell.command.stdout:
      Transaction ID : 10
      Begin time     : Fri Oct  6 10:54:18 2017
      Begin rpmdb    : 253:dc6011e64ea59d2d1b07e4dbe037b7c35d146418
      End time       : Fri Oct  6 10:54:19 2017 (1 seconds)
      End rpmdb      : 255:575e08a5768448b0f226c8f6d1288ef9cb4350a3
      User           : System <unset>
      Return-Code    : Success
      Command Line   : install -y TestA
      Transaction performed with:
          Installed     dnf-2.7.2-2gfc09f4b3.fc26.noarch @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.0.1-7.fc26.x86_64       @koji-override-0
      Packages Altered:
          Install TestA-1-1.noarch @test
          Install TestB-1-1.noarch @test
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'update', '-y']
      shell.command.stdout:
      updates                                         1.1 MB/s | 1.1 kB     00:00    
      Last metadata expiration check: 0:00:00 ago on Fri Oct  6 10:54:19 2017.
      Dependencies resolved.
      ================================================================================
       Package           Arch               Version         Repository           Size
      ================================================================================
      Upgrading:
       TestA             noarch             2-1             updates             5.4 k
       TestB             noarch             2-1             updates             5.4 k
       TestC             noarch             2-1             updates             5.4 k
      
      Transaction Summary
      ================================================================================
      Upgrade  3 Packages
      
      Total size: 16 k
      Downloading Packages:
      Running transaction check
      Transaction check succeeded.
      Running transaction test
      Transaction test succeeded.
      Running transaction
        Preparing        :                                                        1/1 
        Upgrading        : TestC-2-1.noarch                                       1/6 
        Upgrading        : TestB-2-1.noarch                                       2/6 
        Upgrading        : TestA-2-1.noarch                                       3/6 
        Cleanup          : TestA-1-1.noarch                                       4/6 
        Cleanup          : TestB-1-1.noarch                                       5/6 
        Cleanup          : TestC-1-1.noarch                                       6/6 
        Verifying        : TestA-2-1.noarch                                       1/6 
        Verifying        : TestB-2-1.noarch                                       2/6 
        Verifying        : TestC-2-1.noarch                                       3/6 
        Verifying        : TestA-1-1.noarch                                       4/6 
        Verifying        : TestB-1-1.noarch                                       5/6 
        Verifying        : TestC-1-1.noarch                                       6/6 
      
      Upgraded:
        TestA.noarch 2-1          TestB.noarch 2-1          TestC.noarch 2-1         
      
      Complete!
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'history', 'info']
      shell.command.stdout:
      Transaction ID : 11
      Begin time     : Fri Oct  6 10:54:19 2017
      Begin rpmdb    : 255:575e08a5768448b0f226c8f6d1288ef9cb4350a3
      End time       : Fri Oct  6 10:54:20 2017 (1 seconds)
      End rpmdb      : 255:ed0065aa62e7a94f1ce53a65359d8dc541d1d01c
      User           : System <unset>
      Return-Code    : Success
      Command Line   : update -y
      Transaction performed with:
          Installed     dnf-2.7.2-2gfc09f4b3.fc26.noarch @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.0.1-7.fc26.x86_64       @koji-override-0
      Packages Altered:
          Upgraded TestA-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestB-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestC-1-1.noarch @test
          Upgrade        2-1.noarch @updates
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'history', 'info', 'last-1..last']
      shell.command.stdout:
      Transaction ID : 10..11
      Begin time     : Fri Oct  6 10:54:18 2017
      Begin rpmdb    : 253:dc6011e64ea59d2d1b07e4dbe037b7c35d146418
      End time       : Fri Oct  6 10:54:20 2017 (2 seconds)
      End rpmdb      : 255:ed0065aa62e7a94f1ce53a65359d8dc541d1d01c
      User           : System <unset>
      Return-Code    : Success
      Command Line   : install -y TestA
      Command Line   : update -y
      Transaction performed with:
          Installed     dnf-2.7.2-2gfc09f4b3.fc26.noarch @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.0.1-7.fc26.x86_64       @koji-override-0
      Packages Altered:
          Install  TestA-2-1.noarch @updates
          Install  TestB-2-1.noarch @updates
          Upgraded TestC-1-1.noarch @test
          Upgrade        2-1.noarch @updates
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'history', 'info', 'last-2..last']
      shell.command.stdout:
      Transaction ID : 9..11
      Begin time     : Fri Oct  6 10:54:18 2017
      Begin rpmdb    : 253:dc6011e64ea59d2d1b07e4dbe037b7c35d146418
      End time       : Fri Oct  6 10:54:20 2017 (2 seconds)
      End rpmdb      : 255:ed0065aa62e7a94f1ce53a65359d8dc541d1d01c
      User           : System <unset>
      Return-Code    : Success
      Command Line   : install -y TestA
      Command Line   : remove -y TestA
      Command Line   : update -y
      Transaction performed with:
          Installed     dnf-2.7.2-2gfc09f4b3.fc26.noarch @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.0.1-7.fc26.x86_64       @koji-override-0
      Packages Altered:
          Upgraded TestA-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestB-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestC-1-1.noarch @test
          Upgrade        2-1.noarch @updates
      
      shell.command.stderr:
      
      shell.command: ['dnf-2', 'history', 'info', 'last-2..last-1']
      shell.command.stdout:
      Transaction ID : 9..10
      Begin time     : Fri Oct  6 10:54:18 2017
      Begin rpmdb    : 253:dc6011e64ea59d2d1b07e4dbe037b7c35d146418
      End time       : Fri Oct  6 10:54:19 2017 (1 seconds)
      End rpmdb      : 255:575e08a5768448b0f226c8f6d1288ef9cb4350a3
      User           : System <unset>
      Return-Code    : Success
      Command Line   : install -y TestA
      Command Line   : remove -y TestA
      Transaction performed with:
          Installed     dnf-2.7.2-2gfc09f4b3.fc26.noarch @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.0.1-7.fc26.x86_64       @koji-override-0
      Packages Altered:
      
      shell.command.stderr:


  Scenario: History info of package       # behave/history-2-dnf-2.feature:89
    And history info "TestA" should match # behave/steps/command_steps.py:195
      | Key         | Value                      |
      | Return-Code | Success                    |
      | Upgrade     | TestA, TestB               |
      | Upgraded    | TestA, TestB               |
      | Install     | TestA, TestB, TestC, TestE |
      | Erase       | TestA, TestB               |


Failing scenarios:
  behave/history-2-dnf-2.feature:57  History info in range - transaction merging

0 features passed, 1 failed, 0 skipped
6 scenarios passed, 1 failed, 0 skipped
31 steps passed, 1 failed, 0 skipped, 0 undefined
Took 0m8.315s
+ TEST_EXIT=1
+ '[' 0 == -r ']'
+ '[' 0 == -R -a 1 -ne 0 ']'
+ exit 1

Reinstall should fail when source repository is disabled.
When package is being replaced, new package
must keep reason of obsoleted package.
Test whether transactions are merged properly in
history info output.
@edcuba
Copy link
Contributor Author

edcuba commented Oct 9, 2017

This is kinda interesting. Transaction merging in DNF is not working correctly (works fine with SWDB). I tried it several times and found these problems:
Assertion Failed: "TestA" not matched as "Reinstall"

Caused by:

      Transaction ID : 9..10
      Begin time     : Mon Oct  9 08:41:30 2017
      Begin rpmdb    : 256:42c60d967d3cdfa5449883e8b04f406dc61c024d
      End time       : Mon Oct  9 08:41:31 2017 (1 seconds)
      End rpmdb      : 258:d32ee999405ceb17710925a2978babcc7a5c5b82
      User           : System <unset>
      Return-Code    : Success
      Command Line   : install -y TestA
      Command Line   : remove -y TestA
      Transaction performed with:
          Installed     dnf-2.6.4-0.32g3005c7ae.fc27.noarch  @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.90-0.git14002.6.fc27.x86_64 @anaconda
      Packages Altered:

Line

Reinstall TestA-1-1.noarch @test

is missing

and

Assertion Failed: "TestA" not matched as "Upgraded"

caused by

      Transaction ID : 9..11
      Begin time     : Mon Oct  9 08:39:44 2017
      Begin rpmdb    : 258:851d70c9b0f8505331baa72ce3e882d81791ac75
      End time       : Mon Oct  9 08:39:46 2017 (2 seconds)
      End rpmdb      : 258:9f4df76ce341884dfdcd3dc7718401079f3e7a95
      User           : System <unset>
      Return-Code    : Success
      Command Line   : remove -y TestA
      Command Line   : update -y
      Command Line   : install -y TestA
      Transaction performed with:
          Installed     dnf-2.6.4-0.32g3005c7ae.fc27.noarch  @rpmsoftwaremanagement-dnf-nightly
          Installed     rpm-4.13.90-0.git14002.6.fc27.x86_64 @anaconda
      Packages Altered:
          Reinstall TestA-1-1.noarch @test
          Upgrade   TestA-2-1.noarch @updates
          Reinstall TestB-1-1.noarch @test
          Upgrade   TestB-2-1.noarch @updates
          Upgraded  TestC-1-1.noarch @test
          Upgrade         2-1.noarch @updates

while it should be

          Upgraded TestA-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestB-1-1.noarch @test
          Upgrade        2-1.noarch @updates
          Upgraded TestC-1-1.noarch @test
          Upgrade        2-1.noarch @updates

edcuba pushed a commit to edcuba/dnf that referenced this pull request Oct 9, 2017
Make Transaction method `__lt__` work in an expected way.
True if t1.tid < t2.tid, false when t1.tid > t2.tid.
This fixes the behavior of sort method (lowest/oldest first without
    using reverse flag).

Fixes random behavior in CI tests:
    rpm-software-management/ci-dnf-stack#248
edcuba pushed a commit to edcuba/dnf that referenced this pull request Oct 9, 2017
Make Transaction method `__lt__` work in an expected way.
True if t1.tid < t2.tid, false when t1.tid > t2.tid.
This fixes the behavior of sort method (lowest/oldest first without
    using reverse flag).

Fixes random behavior in CI tests:
    rpm-software-management/ci-dnf-stack#248
rh-atomic-bot pushed a commit to rpm-software-management/dnf that referenced this pull request Oct 10, 2017
Make Transaction method `__lt__` work in an expected way.
True if t1.tid < t2.tid, false when t1.tid > t2.tid.
This fixes the behavior of sort method (lowest/oldest first without
    using reverse flag).

Fixes random behavior in CI tests:
    rpm-software-management/ci-dnf-stack#248

Closes: #947
Approved by: <try>
j-mracek pushed a commit to rpm-software-management/dnf that referenced this pull request Oct 10, 2017
Make Transaction method `__lt__` work in an expected way.
True if t1.tid < t2.tid, false when t1.tid > t2.tid.
This fixes the behavior of sort method (lowest/oldest first without
    using reverse flag).

Fixes random behavior in CI tests:
    rpm-software-management/ci-dnf-stack#248
@edcuba
Copy link
Contributor Author

edcuba commented Oct 11, 2017

It should work now

@j-mracek
Copy link
Member

@edynox Thanks, I will run tests several time just to ensure that it is fine.

@j-mracek j-mracek merged commit 9fbdbe3 into rpm-software-management:master Oct 19, 2017
@j-mracek
Copy link
Member

Thanks, no problem discovered.

pkratoch pushed a commit that referenced this pull request Nov 9, 2021
It didn't provide any information why there is any download.

https://bugzilla.redhat.com/show_bug.cgi?id=1550006

Closes: #248
Approved by: m-blaha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants