Skip to content

Commit ce61c10

Browse files
AYUSHJAIN951root
authored andcommitted
Fix patch apply issue
Fix patch application issue caused by incorrect current directory Fixes 8c1cc5b: ("fix patch apply issue") --Before-- ERROR| Traceback (most recent call last): ERROR| File "ebizzy.py", line 76, in setUp ERROR| File "/usr/lib64/python3.9/posixpath.py", line 375, in abspath ERROR| path = os.fspath(path) ERROR| TypeError: expected str, bytes or os.PathLike object, not NoneType ERROR| ERROR| ERROR 1-ebizzy.py:Ebizzy.test;run-duration-default-perf-pin-size-threads-workers-e56a -> TestSetupFail: expected str, bytes or os.PathLike object, not NoneType And similar issue in dwh and linsched tests This change fixes that --After-- DEBUG| DATA (filename=dwh.cpp) => /root/avocado-misc-tests/cpu/dwh.py.data/dwh.cpp (found at file source dir) DATA (filename=Makefile) => /root/avocado-misc-tests/cpu/dwh.py.data/Makefile (found at file source dir) DATA (filename=fofd.patch) => /root/avocado-misc-tests/cpu/dwh.py.data/fofd.patch (found at file source dir) INFO | Running 'patch -p0 < /root/avocado-misc-tests/cpu/dwh.py.data/fofd.patch' DEBUG| [stdout] patching file dwh.cpp INFO | Command 'patch -p0 < /root/avocado-misc-tests/cpu/dwh.py.data/fofd.patch' finished with 0 after 0.003100977s INFO | Running 'make' Signed-off-by: Ayush Jain <ayush.jain3@amd.com>
1 parent 38a2471 commit ce61c10

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

cpu/dwh.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ def setUp(self):
6464

6565
for file_name in ['dwh.cpp', 'Makefile']:
6666
self.copyutil(file_name)
67-
os.chdir(self.teststmpdir)
6867
if dist.name in ['fedora', 'rhel']:
69-
process.system('patch -p0 < %s' %
70-
os.path.abspath(self.get_data('fofd.patch')), shell=True)
68+
cmd = 'patch -p0 < %s' % os.path.abspath(self.get_data('fofd.patch'))
7169
elif dist.name in ['Ubuntu', 'debian']:
72-
process.system("sed -i 's/g++.*/& -lrt/' Makefile", shell=True)
70+
cmd = "sed -i 's/g++.*/& -lrt/' Makefile"
71+
os.chdir(self.teststmpdir)
72+
process.run(cmd, shell=True)
73+
7374
build.make(self.teststmpdir)
7475

7576
def test(self):

cpu/ebizzy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def setUp(self):
7272

7373
patch = self.params.get(
7474
'patch', default='Fix-build-issues-with-ebizzy.patch')
75-
os.chdir(self.sourcedir)
7675
patch_cmd = 'patch -p0 < %s' % os.path.abspath((self.get_data(patch)))
76+
os.chdir(self.sourcedir)
7777
process.run(patch_cmd, shell=True)
7878
process.run('[ -x configure ] && ./configure', shell=True)
7979
build.make(self.sourcedir)

cpu/linsched.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def setUp(self):
5252
self.sourcedir = os.path.join(
5353
self.workdir, 'linux-scheduler-testing-master')
5454

55-
os.chdir(self.sourcedir)
5655
fix_patch = 'patch -p1 < %s' % os.path.abspath(self.get_data('fix.patch'))
56+
os.chdir(self.sourcedir)
5757
process.run(fix_patch, shell=True, ignore_status=True)
5858

5959
build.make(self.sourcedir)

0 commit comments

Comments
 (0)