Compare commits

...

16 Commits
f24 ... master

Author SHA1 Message Date
Fedora Release Engineering
6ecf9d58c5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 15:03:42 +00:00
Igor Gnatenko
127743f0e6 Rebuild for readline 8.0 2019-02-17 09:30:51 +01:00
Fedora Release Engineering
097bf84c74 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 08:52:32 +00:00
Adam Williamson
a30f348307 BuildRequires gcc 2018-07-24 14:58:28 -07:00
Adam Williamson
75ff0e290e Rebuild for new net-snmp 2018-07-24 14:45:48 -07:00
Fedora Release Engineering
e788c0a4bf - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 09:16:13 +00:00
Susant Sahani
f3240b1c15 Fix: lldpd name to requuire package list
ansible-playbook tests.yml
 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [localhost] ***************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************************************************************
ok: [localhost]

TASK [str-common : Check if system is Atomic Host] *****************************************************************************************************************************************************************
ok: [localhost]

TASK [str-common : Set fact 'is_atomic'] ***************************************************************************************************************************************************************************
ok: [localhost]

TASK [str-common : Set facts about system] *************************************************************************************************************************************************************************
ok: [localhost]

TASK [str-common : Hardcode Python interpreter for ansible modules on RHEL8 based OS] ******************************************************************************************************************************
skipping: [localhost]

TASK [str-common : debug] ******************************************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : debug] ******************************************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : debug] ******************************************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : Add test-runner to ansible inventory] ***********************************************************************************************************************************************************
changed: [localhost]

TASK [str-common : Gather facts] ***********************************************************************************************************************************************************************************
ok: [localhost -> test-runner]

TASK [str-common : Set facts about test-runner] ********************************************************************************************************************************************************************
ok: [localhost -> test-runner]

TASK [str-common : Hardcode Python interpreter for ansible modules on RHEL8 based OS] ******************************************************************************************************************************
skipping: [localhost]

TASK [str-common : Fetch tests from remote repositories] ***********************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : debug] ******************************************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : debug] ******************************************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : debug] ******************************************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : debug] ******************************************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : Build packages lists to be present on test environment] *****************************************************************************************************************************************
ok: [localhost]

TASK [str-common : debug] ******************************************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : include_tasks] **********************************************************************************************************************************************************************************
included: /usr/share/ansible/roles/str-common/tasks/pkgs-dnf.yml for localhost

TASK [str-common : Install test-specific package requirements] *****************************************************************************************************************************************************
ok: [localhost] => (item=lldpd)
ok: [localhost] => (item=python3)
ok: [localhost] => (item=tcpdump)
ok: [localhost] => (item=systemd)
ok: [localhost] => (item=iproute)

TASK [str-common : Install the common requirements on target] ******************************************************************************************************************************************************
ok: [localhost] => (item=rsync)

TASK [str-common : Install dnf-utils] ******************************************************************************************************************************************************************************
 [WARNING]: Consider using the dnf module rather than running dnf.  If you need to use command because dnf is insufficient you can add warn=False to this command task or set command_warnings=False in ansible.cfg
to get rid of this message.

changed: [localhost]

TASK [str-common : Install debuginfo packages] *********************************************************************************************************************************************************************

TASK [str-common : package] ****************************************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : Enable copr repos using DNF] ********************************************************************************************************************************************************************
skipping: [localhost]

TASK [str-common : Make artifacts directory] ***********************************************************************************************************************************************************************
changed: [localhost]

TASK [str-common : Copy tests to test environment] *****************************************************************************************************************************************************************
changed: [localhost]

TASK [standard-test-beakerlib : package] ***************************************************************************************************************************************************************************
ok: [localhost -> test-runner]

TASK [standard-test-beakerlib : shell] *****************************************************************************************************************************************************************************
changed: [localhost -> test-runner]

TASK [standard-test-beakerlib : package] ***************************************************************************************************************************************************************************
skipping: [localhost]

TASK [standard-test-beakerlib : shell] *****************************************************************************************************************************************************************************
skipping: [localhost]

TASK [standard-test-beakerlib : Install the beakerlib requirements] ************************************************************************************************************************************************
ok: [localhost -> test-runner] => (item=beakerlib)
ok: [localhost -> test-runner] => (item=restraint-rhts)
ok: [localhost -> test-runner] => (item=rsync)

TASK [standard-test-beakerlib : debug] *****************************************************************************************************************************************************************************
skipping: [localhost]

TASK [standard-test-beakerlib : Install the beakerlib requirements to test environment] ****************************************************************************************************************************
ok: [localhost] => (item=rsync)
ok: [localhost] => (item=findutils)
ok: [localhost] => (item=make)
changed: [localhost] => (item=libselinux-python)
ok: [localhost] => (item=python2-lxml)

TASK [standard-test-beakerlib : Put beakerlib binaries to test environment] ****************************************************************************************************************************************
ok: [localhost] => (item=/usr/bin/beakerlib-testwatcher)
ok: [localhost] => (item=/usr/bin/beakerlib-lsb_release)
ok: [localhost] => (item=/usr/bin/beakerlib-journalling)
ok: [localhost] => (item=/usr/bin/beakerlib-journalcmp)
ok: [localhost] => (item=/usr/bin/beakerlib-rlMemPeak)
ok: [localhost] => (item=/usr/bin/beakerlib-rlMemAvg)
ok: [localhost] => (item=/usr/bin/beakerlib-deja-summarize)
ok: [localhost] => (item=/usr/share/beakerlib/journal.sh)
ok: [localhost] => (item=/usr/share/beakerlib/testing.sh)
ok: [localhost] => (item=/usr/share/beakerlib/synchronisation.sh)
ok: [localhost] => (item=/usr/share/beakerlib/analyze.sh)
ok: [localhost] => (item=/usr/share/beakerlib/performance.sh)
changed: [localhost] => (item=/usr/share/beakerlib/libraries.sh)
ok: [localhost] => (item=/usr/share/beakerlib/dictionary.vim)
ok: [localhost] => (item=/usr/share/beakerlib/rpms.sh)
ok: [localhost] => (item=/usr/share/beakerlib/storage.sh)
changed: [localhost] => (item=/usr/share/beakerlib/beakerlib.sh)
ok: [localhost] => (item=/usr/share/beakerlib/virtualX.sh)
ok: [localhost] => (item=/usr/share/beakerlib/infrastructure.sh)
ok: [localhost] => (item=/usr/share/beakerlib/logging.sh)
ok: [localhost] => (item=/usr/bin/rhts-lint)
ok: [localhost] => (item=/usr/bin/rhts-submit-log)
ok: [localhost] => (item=/usr/bin/rhts-flush)
ok: [localhost] => (item=/usr/bin/rhts-recipe-sync-block)
ok: [localhost] => (item=/usr/bin/rhts-recipe-sync-set)
ok: [localhost] => (item=/usr/bin/rhts-reboot)
ok: [localhost] => (item=/usr/bin/rhts-sync-set)
ok: [localhost] => (item=/usr/bin/rhts-environment.sh)
ok: [localhost] => (item=/usr/bin/rhts-backup)
ok: [localhost] => (item=/usr/bin/rhts-abort)
ok: [localhost] => (item=/usr/bin/rhts-report-result)
changed: [localhost] => (item=/usr/bin/rhts-run-simple-test)
ok: [localhost] => (item=/usr/bin/rhts-sync-block)
ok: [localhost] => (item=/usr/bin/rhts-restore)
ok: [localhost] => (item=/usr/share/rhts/lib/rhts-make.include)
ok: [localhost] => (item=/usr/bin/rstrnt-backup)
ok: [localhost] => (item=/usr/bin/rstrnt-package)
ok: [localhost] => (item=/usr/bin/rstrnt-abort)
ok: [localhost] => (item=/usr/bin/rstrnt-adjust-watchdog)
ok: [localhost] => (item=/usr/bin/rstrnt-reboot)
ok: [localhost] => (item=/usr/bin/rstrnt-sync)
ok: [localhost] => (item=/usr/bin/rstrnt-report-log)
ok: [localhost] => (item=/usr/bin/rstrnt-restore)
ok: [localhost] => (item=/usr/bin/rstrnt-report-result)
ok: [localhost] => (item=/usr/share/ansible/roles/standard-test-beakerlib/files/rpm.py)

TASK [standard-test-beakerlib : Copy tests to test environment] ****************************************************************************************************************************************************
changed: [localhost]

TASK [standard-test-beakerlib : Fix up beakerlib at tests environment] *********************************************************************************************************************************************
changed: [localhost]

TASK [standard-test-beakerlib : Run beakerlib tests] ***************************************************************************************************************************************************************
changed: [localhost] => (item=miscellaneous-tests)

TASK [standard-test-beakerlib : Make the master tests summary log artifact] ****************************************************************************************************************************************
changed: [localhost] => (item=miscellaneous-tests)

TASK [standard-test-beakerlib : include_role] **********************************************************************************************************************************************************************

TASK [str-common : Pull out the logs from test environment to test runner] *****************************************************************************************************************************************
changed: [localhost]

TASK [standard-test-beakerlib : Check the results] *****************************************************************************************************************************************************************
changed: [localhost]

PLAY RECAP *********************************************************************************************************************************************************************************************************
localhost                  : ok=25   changed=13   unreachable=0    failed=0

posix          	on

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Package       : lldpd
    Installed     : lldpd-1.0.1-1.fc29.x86_64
    beakerlib RPM : beakerlib-1.17-13.fc29.noarch
    Test started  : 2018-05-24 01:29:14 IST
    Test finished :
    Test duration :
    Test name     : miscellaneous-tests
    Distro        : Fedora release 29 (Rawhide)
    Hostname      : Zeus
    Architecture  : x86_64
    CPUs          : 1 x Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
    RAM size      : 963 MB
    HDD size      : 6.98 GB
:: [ 01:29:14 ] :: [ WARNING  ] :: POSIX mode detected and switched off
:: [ 01:29:14 ] :: [ WARNING  ] :: POSIX mode detected and switched off
:: [ 01:29:14 ] :: [ WARNING  ] :: Please fix your test to have /bin/bash shebang
:: [ 01:29:14 ] :: [ WARNING  ] :: Please fix your test to have /bin/bash shebang

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Setup
::   Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

lldpd-1.0.1-1.fc29.x86_64
:: [ 01:29:14 ] :: [   PASS   ] :: Checking for the presence of lldpd rpm
:: [ 01:29:14 ] :: [   PASS   ] :: Checking for the presence of lldpd rpm
:: [ 01:29:14 ] :: [   LOG    ] :: Package versions:
:: [ 01:29:14 ] :: [   LOG    ] :: Package versions:
:: [ 01:29:14 ] :: [   LOG    ] ::   lldpd-1.0.1-1.fc29.x86_64
:: [ 01:29:14 ] :: [   LOG    ] ::   lldpd-1.0.1-1.fc29.x86_64
:: [ 01:29:14 ] :: [  BEGIN   ] :: Running 'cp lldpd-tests.py /usr/bin/'
:: [ 01:29:14 ] :: [   PASS   ] :: Command 'cp lldpd-tests.py /usr/bin/' (Expected 0, got 0)
:: [ 01:29:14 ] :: [   PASS   ] :: Command 'cp lldpd-tests.py /usr/bin/' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 0s
::   Duration: 0s
::   Assertions: 2 good, 0 bad
::   Assertions: 2 good, 0 bad
::   RESULT: PASS
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Test
::   Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 01:29:14 ] :: [   LOG    ] :: lladpd tests
:: [ 01:29:14 ] :: [   LOG    ] :: lladpd tests
:: [ 01:29:14 ] :: [  BEGIN   ] :: Running '/usr/bin/python3 /usr/bin/lldpd-tests.py'
test_lldpd_trasmitted_lldp_attributes (__main__.lldpdTests)
verify at the other end of veth received LLDP packets that contains attibutes (link address, hostname, TTL, system desc). tcpdump ... reading from file /tmp/lldpd-tcp-dump.pcap, link-type EN10MB (Ethernet)
ok
test_lldpd_trasmitted_lldp_packets (__main__.lldpdTests)
verify at the other end of veth ifname lldpd has received LLDP packets. tcpdump ... reading from file /tmp/lldpd-tcp-dump.pcap, link-type EN10MB (Ethernet)
ok
test_lldpd_received_lldp_packets_sent_by_systemd_networkd (__main__.lldpdTestsViaNetworkd) ... ok
test_systemd_networkd_received_lldp_packets (__main__.lldpdTestsViaNetworkd) ... ok

----------------------------------------------------------------------
Ran 4 tests in 63.926s

OK
:: [ 01:30:18 ] :: [   PASS   ] :: Command '/usr/bin/python3 /usr/bin/lldpd-tests.py' (Expected 0, got 0)
:: [ 01:30:18 ] :: [   PASS   ] :: Command '/usr/bin/python3 /usr/bin/lldpd-tests.py' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 64s
::   Duration: 64s
::   Assertions: 1 good, 0 bad
::   Assertions: 1 good, 0 bad
::   RESULT: PASS
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Cleanup
::   Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 01:30:18 ] :: [  BEGIN   ] :: Running 'rm /usr/bin/lldpd-tests.py'
:: [ 01:30:18 ] :: [   PASS   ] :: Command 'rm /usr/bin/lldpd-tests.py' (Expected 0, got 0)
:: [ 01:30:18 ] :: [   PASS   ] :: Command 'rm /usr/bin/lldpd-tests.py' (Expected 0, got 0)
:: [ 01:30:18 ] :: [   LOG    ] :: lladpd tests done
:: [ 01:30:18 ] :: [   LOG    ] :: lladpd tests done
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 0s
::   Duration: 0s
::   Assertions: 1 good, 0 bad
::   Assertions: 1 good, 0 bad
::   RESULT: PASS
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Package       : lldpd
    Installed     : lldpd-1.0.1-1.fc29.x86_64
    beakerlib RPM : beakerlib-1.17-13.fc29.noarch
    Test started  : 2018-05-24 01:29:14 IST
    Test finished : 2018-05-24 01:30:18 IST (still running)
    Test duration : 64 seconds
    Test name     : miscellaneous-tests
    Distro        : Fedora release 29 (Rawhide)
    Hostname      : Zeus
    Architecture  : x86_64
    CPUs          : 1 x Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
    RAM size      : 963 MB
    HDD size      : 6.98 GB
:: [ 01:29:14 ] :: [ WARNING  ] :: POSIX mode detected and switched off
:: [ 01:29:14 ] :: [ WARNING  ] :: Please fix your test to have /bin/bash shebang

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 01:29:14 ] :: [   PASS   ] :: Checking for the presence of lldpd rpm
:: [ 01:29:14 ] :: [   LOG    ] :: Package versions:
:: [ 01:29:14 ] :: [   LOG    ] ::   lldpd-1.0.1-1.fc29.x86_64
:: [ 01:29:14 ] :: [   PASS   ] :: Command 'cp lldpd-tests.py /usr/bin/' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 0s
::   Assertions: 2 good, 0 bad
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 01:29:14 ] :: [   LOG    ] :: lladpd tests
:: [ 01:30:18 ] :: [   PASS   ] :: Command '/usr/bin/python3 /usr/bin/lldpd-tests.py' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 64s
::   Assertions: 1 good, 0 bad
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 01:30:18 ] :: [   PASS   ] :: Command 'rm /usr/bin/lldpd-tests.py' (Expected 0, got 0)
:: [ 01:30:18 ] :: [   LOG    ] :: lladpd tests done
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 0s
::   Assertions: 1 good, 0 bad
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   miscellaneous-tests
::   miscellaneous-tests
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 01:30:18 ] :: [   LOG    ] :: JOURNAL XML: /var/tmp/beakerlib-o97vwu4/journal.xml
:: [ 01:30:18 ] :: [   LOG    ] :: JOURNAL XML: /var/tmp/beakerlib-o97vwu4/journal.xml
:: [ 01:30:18 ] :: [   LOG    ] :: JOURNAL TXT: /var/tmp/beakerlib-o97vwu4/journal.txt
:: [ 01:30:18 ] :: [   LOG    ] :: JOURNAL TXT: /var/tmp/beakerlib-o97vwu4/journal.txt
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 64s
::   Duration: 64s
::   Phases: 3 good, 0 bad
::   Phases: 3 good, 0 bad
::   OVERALL RESULT: PASS
::   OVERALL RESULT: PASS
2018-05-24 01:37:17 +05:30
Susant Sahani
28fe98a570 Adds tests according to the CI
Justification
Adds tests according to the CI wiki specifically the standard test interface in the spec.
The playbook includes Tier1 level test cases that have been tested in the following contexts and
is passing reliably: Classic. Test logs are stored in the artifacts directory.
The following steps are used to execute the tests using the standard test interface:

Test enveronment
Make sure you have installed packages from the spec
```
ansible-2.4.1.0-2.fc28.noarch
python2-dnf-2.7.5-1.fc28.noarch
libselinux-python-2.7-2.fc28.x86_64
standard-test-roles-2.5-1.fc28.noarch
Run tests for Classic
Snip of the example test run for Classic tests:
```

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

lldpd-1.0.1-1.fc28.x86_64
:: [ 17:45:16 ] :: [   PASS   ] :: Checking for the presence of lldpd rpm
:: [ 17:45:16 ] :: [   LOG    ] :: Package versions:
:: [ 17:45:16 ] :: [   LOG    ] ::   lldpd-1.0.1-1.fc28.x86_64
:: [ 17:45:16 ] :: [  BEGIN   ] :: Running 'cp lldpd-tests.py /usr/bin/'
:: [ 17:45:16 ] :: [   PASS   ] :: Command 'cp lldpd-tests.py /usr/bin/' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 0s
::   Assertions: 2 good, 0 bad
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 17:45:16 ] :: [   LOG    ] :: lladpd tests
:: [ 17:45:16 ] :: [  BEGIN   ] :: Running '/usr/bin/python3 /usr/bin/lldpd-tests.py'
test_lldpd_trasmitted_lldp_attributes (__main__.lldpdTests)
verify at the other end of veth received LLDP packets that contains attibutes (link address, hostname, TTL, system desc). tcpdump ... reading from file /tmp/lldpd-tcp-dump.pcap, link-type EN10MB (Ethernet)
ok
test_lldpd_trasmitted_lldp_packets (__main__.lldpdTests)
verify at the other end of veth ifname lldpd has received LLDP packets. tcpdump ... reading from file /tmp/lldpd-tcp-dump.pcap, link-type EN10MB (Ethernet)
ok
test_lldpd_received_lldp_packets_sent_by_systemd_networkd (__main__.lldpdTestsViaNetworkd) ... ok
test_systemd_networkd_received_lldp_packets (__main__.lldpdTestsViaNetworkd) ... ok

----------------------------------------------------------------------
Ran 4 tests in 64.222s

OK
:: [ 17:46:21 ] :: [   PASS   ] :: Command '/usr/bin/python3 /usr/bin/lldpd-tests.py' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 65s
::   Assertions: 1 good, 0 bad
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 17:46:21 ] :: [  BEGIN   ] :: Running 'rm /usr/bin/lldpd-tests.py'
:: [ 17:46:21 ] :: [   PASS   ] :: Command 'rm /usr/bin/lldpd-tests.py' (Expected 0, got 0)
:: [ 17:46:21 ] :: [   LOG    ] :: lladpd tests done
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 0s
::   Assertions: 1 good, 0 bad
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Package       : lldpd
    Installed     : lldpd-1.0.1-1.fc28.x86_64
    beakerlib RPM : beakerlib-1.17-13.fc28.noarch
    Test started  : 2018-05-23 17:45:15 IST
    Test finished : 2018-05-23 17:46:21 IST (still running)
    Test duration : 66 seconds
    Test name     : unknown
    Distro        : Fedora release 28 (Twenty Eight)
    Hostname      : Zeus
    Architecture  : x86_64
    CPUs          : 8 x Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
    RAM size      : 15731 MB
    HDD size      : 226.83 GB

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 17:45:16 ] :: [   PASS   ] :: Checking for the presence of lldpd rpm
:: [ 17:45:16 ] :: [   LOG    ] :: Package versions:
:: [ 17:45:16 ] :: [   LOG    ] ::   lldpd-1.0.1-1.fc28.x86_64
:: [ 17:45:16 ] :: [   PASS   ] :: Command 'cp lldpd-tests.py /usr/bin/' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 0s
::   Assertions: 2 good, 0 bad
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 17:45:16 ] :: [   LOG    ] :: lladpd tests
:: [ 17:46:21 ] :: [   PASS   ] :: Command '/usr/bin/python3 /usr/bin/lldpd-tests.py' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 65s
::   Assertions: 1 good, 0 bad
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 17:46:21 ] :: [   PASS   ] :: Command 'rm /usr/bin/lldpd-tests.py' (Expected 0, got 0)
:: [ 17:46:21 ] :: [   LOG    ] :: lladpd tests done
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 0s
::   Assertions: 1 good, 0 bad
::   RESULT: PASS

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   unknown
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 17:46:21 ] :: [   LOG    ] :: JOURNAL XML: /var/tmp/beakerlib-msOLBiM/journal.xml
:: [ 17:46:21 ] :: [   LOG    ] :: JOURNAL TXT: /var/tmp/beakerlib-msOLBiM/journal.txt
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 66s
::   Phases: 3 good, 0 bad
::   OVERALL RESULT: PASS
2018-05-23 17:48:08 +05:30
James Hogarth
5211a095d4 update to 1.0.1 2018-04-18 02:08:52 +01:00
Fedora Release Engineering
79dced3f6a - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-08 00:01:45 +00:00
James Hogarth
ab58163b33 update to 0.9.8 2017-08-21 09:32:56 +01:00
Igor Gnatenko
297d2b100c Rebuilt after RPM update (№ 3)
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2017-08-11 11:09:50 +02:00
Igor Gnatenko
87910f0599 Rebuilt for RPM soname bump
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2017-08-10 22:10:05 +02:00
Igor Gnatenko
b702b8bf86 Rebuilt for RPM soname bump
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2017-08-10 20:27:31 +02:00
Fedora Release Engineering
9975eaeeb2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 02:41:22 +00:00
Fedora Release Engineering
8b1f61747b - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 20:13:34 +00:00
6 changed files with 314 additions and 3 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
/lldpd-0.9.7.tar.gz
/lldpd-0.9.8.tar.gz
/lldpd-1.0.1.tar.gz

View File

@ -9,8 +9,8 @@
%global gh_owner vincentbernat
Name: lldpd
Version: 0.9.7
Release: 5%{?dist}
Version: 1.0.1
Release: 6%{?dist}
Summary: ISC-licensed implementation of LLDP
License: ISC
@ -22,6 +22,7 @@ Source3: %{name}-fedora.sysconfig
Source4: %{name}-el6.init
Source5: %{name}-el7.service
BuildRequires: gcc
BuildRequires: readline-devel
BuildRequires: check-devel
BuildRequires: net-snmp-devel
@ -99,6 +100,7 @@ rm -rf %{buildroot}/usr/share/doc/%{name}
# don't include completion conf yet
rm -f %{buildroot}/usr/share/bash-completion/completions/lldpcli
rm -f %{buildroot}/usr/share/zsh/vendor-completions/_lldpcli
rm -f %{buildroot}/usr/share/zsh/site-functions/_lldpcli
# remove static libtool archive
rm -f %{buildroot}%{_libdir}/liblldpctl.la
@ -170,6 +172,45 @@ fi
%changelog
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.1-5
- Rebuild for readline 8.0
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jul 24 2018 Adam Williamson <awilliam@redhat.com> - 1.0.1-3
- Rebuild for new net-snmp
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Apr 17 2018 James Hogarth <james.hogarth@gmail.com> - 1.0.1-1
- Update to 1.0.1
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Mon Aug 21 2017 James Hogarth <james.hogarth@gmail.com> - 0.9.8-1
- Update to 0.9.8
* Fri Aug 11 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.7-10
- Rebuilt after RPM update (№ 3)
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.7-9
- Rebuilt for RPM soname bump
* Thu Aug 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.9.7-8
- Rebuilt for RPM soname bump
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Apr 06 2017 James Hogarth <james.hogarth@gmail.com> - 0.9.7-5
- Older fedora needs the older syntax matching EPEL7

View File

@ -1 +1 @@
SHA512 (lldpd-0.9.7.tar.gz) = 6b087de11b54c3f731498081680c836a28b882b7e925150d8ca3a582538f6a9c294d1e94b8e906a7cbb40e9663eedb33699eddb870c186da4d88cf3a88238ae2
SHA512 (lldpd-1.0.1.tar.gz) = 61b2a7a3a78276c613c6d0b34eb625e69e5c8a206b6658a167d6a09ac6d0e1c943e46c0ff6fc3538a791d9947f193185b65848da581b3d6ecb9bc0befadde8dd

View File

@ -0,0 +1,220 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1+
# ~~~
# lldpd-test.py integration test
# Description: Test for lldpd: implementation of IEEE 802.1ab (LLDP)
#
# Author: Susant Sahani <susant@redhat.com>
# Copyright (c) 2018 Red Hat, Inc.
#~~~
import errno
import os
import sys
import time
import unittest
import subprocess
import signal
import shutil
import re
import psutil
import socket
LLDPD_TCP_DUMP_FILE='/tmp/lldpd-tcp-dump.pcap'
LLDPD_PID_FILE='/var/run/lldpd.pid'
SERVICE_UNITDIR = '/run/systemd/system'
NETWORK_UNITDIR = '/run/systemd/network'
def setUpModule():
"""Initialize the environment, and perform sanity checks on it."""
if shutil.which('lldpd') is None:
raise OSError(errno.ENOENT, 'lldpd not found')
# Ensure the unit directory exists so tests can dump files into it.
os.makedirs(NETWORK_UNITDIR, exist_ok=True)
class lldpdUtilities():
"""Provide a set of utility functions start stop lldpd ."""
def Startlldpd(self):
"""Start lldpd interface lldpd-peer """
subprocess.check_output(['/usr/sbin/lldpd', '-cfse', '-D', '-C', 'lldpd-peer', '-I', 'lldpd-peer', '-S', 'lldpd-system-name','-m', '192.168.50.6'])
def Stoplldpd(self):
try:
with open(LLDPD_PID_FILE, 'r') as f:
pid = f.read().rstrip(' \t\r\n\0')
os.kill(int(pid), signal.SIGTERM)
os.remove(LLDPD_PID_FILE)
except IOError:
pass
def StartCaptureLLDPPackets(self):
"""Start tcpdump to capture packets"""
self.WriteServiceFile('tcpdump.service', '''\
[Unit]
Description=TCPDumpd
After=multi-user.target network.target
[Service]
Type=simple
ExecStart=/usr/sbin/tcpdump -pnnli lldpd ether proto 0x88cc -vvv -w "/tmp/lldpd-tcp-dump.pcap"
[Install]
WantedBy=multi-user.target
''')
subprocess.check_output(['systemctl','daemon-reload'])
subprocess.check_output(['systemctl','restart', 'tcpdump.service'])
def StopCapturingPackets(self):
subprocess.check_output(['systemctl', 'stop', 'tcpdump.service'])
time.sleep(3);
def SetupVethInterface(self):
"""Setup veth interface"""
subprocess.check_output(['ip', 'link', 'add', 'lldpd', 'type', 'veth', 'peer', 'name', 'lldpd-peer'])
subprocess.check_output(['ip', 'link', 'set', 'lldpd', 'address', '02:01:02:03:04:08'])
subprocess.check_output(['ip', 'link', 'set', 'lldpd-peer', 'address', '02:01:02:03:04:09'])
subprocess.check_output(['ip', 'link', 'set', 'lldpd', 'up'])
subprocess.check_output(['ip', 'link', 'set', 'lldpd-peer', 'up'])
time.sleep(3);
self.addCleanup(subprocess.call, ['ip', 'link', 'del', 'dev', 'lldpd'])
def WriteServiceFile(self, unit_name, contents):
"""Write a tcpdump unit file, and queue it to be removed."""
unit_path = os.path.join(SERVICE_UNITDIR, unit_name)
with open(unit_path, 'w') as unit:
unit.write(contents)
self.addCleanup(os.remove, unit_path)
def WriteNetworkFile(self, unit_name, contents):
"""Write a networkd unit file, and queue it to be removed."""
unit_path = os.path.join(NETWORK_UNITDIR, unit_name)
with open(unit_path, 'w') as unit:
unit.write(contents)
self.addCleanup(os.remove, unit_path)
def FindProtocolFieldsinTCPDump(self, **kwargs):
"""Look attributes in lldpd logs."""
contents = subprocess.check_output(['tcpdump', '-v', '-r', LLDPD_TCP_DUMP_FILE]).rstrip().decode('utf-8')
if kwargs is not None:
for key in kwargs:
self.assertRegex(contents, kwargs[key])
class lldpdTestsViaNetworkd(unittest.TestCase, lldpdUtilities):
def setUp(self):
""" Setup veth interface """
self.WriteNetworkFile('lldpd-veth.netdev', '''\
[NetDev]
Name=lldpd
Kind=veth
MACAddress=12:34:56:78:9a:bc
[Peer]
Name=lldpd-peer
MACAddress=12:34:56:78:9a:bd
''')
""" Receive LLDP packets via networkd """
self.WriteNetworkFile('lldp.network', '''\
[Match]
Name=lldpd
[Network]
DHCP=no
IPv6AcceptRA=false
LLDP=yes
EmitLLDP=yes
''')
""" Receive LLDP packets via networkd """
self.WriteNetworkFile('lldp-peer.network', '''\
[Match]
Name=lldpd-peer
''')
subprocess.check_output(['systemctl', 'restart', 'systemd-networkd'])
time.sleep(5)
def tearDown(self):
self.Stoplldpd()
subprocess.check_output(['ip', 'link', 'del', 'lldpd'])
def test_lldpd_received_lldp_packets_sent_by_systemd_networkd(self):
self.Startlldpd()
time.sleep(10)
''' Test whether lldpd receved LLDP packets from networkd '''
output=subprocess.check_output(['lldpctl']).rstrip().decode('utf-8')
self.assertRegex(output, "ifname lldpd")
self.assertRegex(output, socket.gethostname())
def test_systemd_networkd_received_lldp_packets(self):
self.Startlldpd()
time.sleep(10)
# lldpd 02:01:02:03:04:09 [hostname] 02:01:02:03:04:09 lldpd-peer
output=subprocess.check_output(['networkctl', 'lldp', '--no-legend', '--no-pager']).rstrip().decode('utf-8')
self.assertRegex(output, "lldpd")
self.assertRegex(output, "lldpd-peer")
self.assertRegex(output, "12:34:56:78:9a:bd")
self.assertRegex(output, socket.gethostname())
# Port ID and Chasiss id count should be 2
self.assertEqual(2, output.count("12:34:56:78:9a:bd"))
class lldpdTests(unittest.TestCase, lldpdUtilities):
def setUp(self):
""" Setup """
self.SetupVethInterface()
def tearDown(self):
self.Stoplldpd()
os.remove(LLDPD_TCP_DUMP_FILE)
def test_lldpd_trasmitted_lldp_attributes(self):
""" verify at the other end of veth received LLDP packets that contains attibutes (link address, hostname, TTL, system desc). tcpdump """
self.StartCaptureLLDPPackets()
self.Startlldpd()
""" capture for 10 seconds """
time.sleep(10)
self.StopCapturingPackets()
self.FindProtocolFieldsinTCPDump(Chassis='Subtype MAC address \(4\): 02:01:02:03:04:09',
Port='Subtype MAC address \(3\): 02:01:02:03:04:09',
PortDesc='lldpd-peer',
TTL='TTL.*120s',
HostName=socket.gethostname() ,
System_Description='lldpd-system-name',
ManagementAddress='192.168.50.6')
def test_lldpd_trasmitted_lldp_packets(self):
""" verify at the other end of veth ifname lldpd has received LLDP packets. tcpdump """
self.StartCaptureLLDPPackets()
self.Startlldpd()
""" capture for 10 seconds """
time.sleep(10)
self.StopCapturingPackets()
self.FindProtocolFieldsinTCPDump(MAC='02:01:02:03:04:09',
TTL='TTL 120s')
if __name__ == '__main__':
unittest.main(testRunner=unittest.TextTestRunner(stream=sys.stdout,
verbosity=2))

View File

@ -0,0 +1,35 @@
#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1+
# ~~~
# LLDPD integration test
# Description: Test for ladpd:implementation of IEEE 802.1ab (LLDP)
#
# Author: Susant Sahani <susant@redhat.com>
# Copyright (c) 2018 Red Hat, Inc.
#~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="lldpd"
LadpdPidFile="/var/run/lldpd.pid"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "cp lldpd-tests.py /usr/bin/"
rlPhaseEnd
rlPhaseStartTest
rlLog "lladpd tests"
rlRun "/usr/bin/python3 /usr/bin/lldpd-tests.py"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "rm /usr/bin/lldpd-tests.py"
rlLog "lladpd tests done"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd
rlGetTestState

13
tests/tests.yml Normal file
View File

@ -0,0 +1,13 @@
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
tests:
- miscellaneous-tests
required_packages:
- lldpd
- python3
- tcpdump
- systemd
- iproute