-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d26b490
commit a32dc52
Showing
3 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ Makefile.in | |
*.status | ||
*.log | ||
*.pc | ||
*.spec | ||
*.patch | ||
*.diff | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# tdnf-bad-pre spec file | ||
# | ||
Summary: basic install test file. | ||
Name: tdnf-bad-pre | ||
Version: 1.0.0 | ||
Release: 1 | ||
Vendor: VMware, Inc. | ||
Distribution: Photon | ||
License: VMware | ||
Url: http://www.vmware.com | ||
Group: Applications/tdnftest | ||
|
||
%description | ||
Part of tdnf test spec. Test bad install scripts. | ||
|
||
%prep | ||
|
||
%build | ||
|
||
%install | ||
mkdir -p %_topdir/%buildroot/usr/bin | ||
cat << EOF >> %_topdir/%buildroot/usr/bin/bad-pre.sh | ||
#!/bin/sh | ||
# dummy script. Return false because we are bad. | ||
/bin/false | ||
EOF | ||
|
||
%pre | ||
# fail intentionally | ||
/bin/false | ||
|
||
%files | ||
/usr/bin/bad-pre.sh | ||
|
||
%changelog | ||
* Fri Apr 2 2021 Oliver Kurth <[email protected]> 1.0.0-1 | ||
initial package to test '--setopt=tsflags=noscripts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Copyright (C) 2019 - 2020 VMware, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the GNU General Public License v2 (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. | ||
# | ||
# Author: Oliver Kurth <[email protected]> | ||
|
||
import os | ||
import tempfile | ||
import pytest | ||
|
||
@pytest.fixture(scope='module', autouse=True) | ||
def setup_test(utils): | ||
yield | ||
teardown_test(utils) | ||
|
||
def teardown_test(utils): | ||
pkgname = 'tdnf-bad-pre' | ||
utils.run(['tdnf', 'erase', '-y', pkgname]) | ||
|
||
# Verify that the package is really bad: | ||
def test_install_normal(utils): | ||
pkgname = 'tdnf-bad-pre' | ||
ret = utils.run([ 'tdnf', 'install' ,'-y', '--nogpgcheck', pkgname]) | ||
assert(ret['retval'] == 1525) | ||
|
||
def test_install_noscripts(utils): | ||
pkgname = 'tdnf-bad-pre' | ||
ret = utils.run([ 'tdnf', 'install' ,'-y', '--nogpgcheck', | ||
'--setopt=tsflags=noscripts', pkgname]) | ||
assert(ret['retval'] == 0) | ||
|