diff --git a/hardware/benchmark/mem.py b/hardware/benchmark/mem.py
index abd4fd02..1a30ba36 100644
--- a/hardware/benchmark/mem.py
+++ b/hardware/benchmark/mem.py
@@ -22,6 +22,8 @@ import re
 import subprocess
 import sys
 
+import six
+
 from hardware.benchmark import utils
 
 
@@ -88,6 +90,8 @@ def run_sysbench_memory_threaded(hw_lst, max_time, block_size, cpu_count,
                                     shell=True, stdout=subprocess.PIPE)
 
     for line in sysbench_cmd.stdout:
+        if isinstance(line, six.binary_type):
+            line = line.decode()
         if "transferred" in line:
             _, right = line.rstrip('\n').replace(' ', '').split('(')
             perf, _ = right.split('.')
@@ -125,6 +129,8 @@ def run_sysbench_memory_forked(hw_lst, max_time, block_size, cpu_count):
     process = subprocess.Popen(
         sysbench_cmd, shell=True, stdout=subprocess.PIPE)
     for line in process.stdout:
+        if isinstance(line, six.binary_type):
+            line = line.decode()
         if "transferred" in line:
             _, right = line.rstrip('\n').replace(' ', '').split('(')
             perf, _ = right.split('.')

Mem benchmark fails with Python 3
MEM benchmarking fails with error "a bytes-like object is required, not 'str'"

```
hardware-detect --benchmark mem
...
Memory Performance: 8 logical CPU to test (ETA: 350 seconds)
Benchmarking memory @1K from CPU 0 for 5 seconds (1 threads)
Traceback (most recent call last):
  File "/usr/bin/hardware-detect", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.6/site-packages/hardware/detect.py", line 981, in main
    bm_mem.mem_perf(hrdw)
  File "/usr/lib/python3.6/site-packages/hardware/benchmark/mem.py", line 152, in mem_perf
    block_size, 1, cpu_nb)
  File "/usr/lib/python3.6/site-packages/hardware/benchmark/mem.py", line 91, in run_sysbench_memory_threaded
    if "transferred" in line:
TypeError: a bytes-like object is required, not 'str'
```

Original report:
https://bugzilla.redhat.com/show_bug.cgi?id=1753653
diff --git a/hardware/tests/test_benchmark_mem.py b/hardware/tests/test_benchmark_mem.py
index 1c0e9e2c..445a4c50 100644
--- a/hardware/tests/test_benchmark_mem.py
+++ b/hardware/tests/test_benchmark_mem.py
@@ -41,7 +41,40 @@ Test execution summary:
 
 Threads fairness:
     events (avg/stddev):           1957354.0000/0.00
-    execution time (avg/stddev):   3.0686/0.00""".splitlines()
+    execution time (avg/stddev):   3.0686/0.00"""
+
+EXPECTED_RESULT = [
+    ('cpu', 'logical', 'number', 2),
+    ('cpu', 'physical', 'number', 2),
+    ('cpu', 'logical_0', 'bandwidth_1K', '382'),
+    ('cpu', 'logical_0', 'bandwidth_4K', '382'),
+    ('cpu', 'logical_0', 'bandwidth_1M', '382'),
+    ('cpu', 'logical_0', 'bandwidth_16M', '382'),
+    ('cpu', 'logical_0', 'bandwidth_128M', '382'),
+    ('cpu', 'logical_0', 'bandwidth_1G', '382'),
+    ('cpu', 'logical_0', 'bandwidth_2G', '382'),
+    ('cpu', 'logical_1', 'bandwidth_1K', '382'),
+    ('cpu', 'logical_1', 'bandwidth_4K', '382'),
+    ('cpu', 'logical_1', 'bandwidth_1M', '382'),
+    ('cpu', 'logical_1', 'bandwidth_16M', '382'),
+    ('cpu', 'logical_1', 'bandwidth_128M', '382'),
+    ('cpu', 'logical_1', 'bandwidth_1G', '382'),
+    ('cpu', 'logical_1', 'bandwidth_2G', '382'),
+    ('cpu', 'logical', 'threaded_bandwidth_1K', '382'),
+    ('cpu', 'logical', 'threaded_bandwidth_4K', '382'),
+    ('cpu', 'logical', 'threaded_bandwidth_1M', '382'),
+    ('cpu', 'logical', 'threaded_bandwidth_16M', '382'),
+    ('cpu', 'logical', 'threaded_bandwidth_128M', '382'),
+    ('cpu', 'logical', 'threaded_bandwidth_1G', '382'),
+    ('cpu', 'logical', 'threaded_bandwidth_2G', '382'),
+    ('cpu', 'logical', 'forked_bandwidth_1K', '382'),
+    ('cpu', 'logical', 'forked_bandwidth_4K', '382'),
+    ('cpu', 'logical', 'forked_bandwidth_1M', '382'),
+    ('cpu', 'logical', 'forked_bandwidth_16M', '382'),
+    ('cpu', 'logical', 'forked_bandwidth_128M', '382'),
+    ('cpu', 'logical', 'forked_bandwidth_1G', '382'),
+    ('cpu', 'logical', 'forked_bandwidth_2G', '382')
+]
 
 
 @mock.patch.object(mem, 'get_available_memory')
@@ -54,44 +87,26 @@ class TestBenchmarkMem(unittest.TestCase):
         self.hw_data = [('cpu', 'logical', 'number', 2),
                         ('cpu', 'physical', 'number', 2)]
 
-    def test_mem_perf(self, mock_popen, mock_cpu_socket, mock_get_memory):
+    def test_mem_perf_bytes(self, mock_popen, mock_cpu_socket,
+                            mock_get_memory):
         mock_get_memory.return_value = 123456789012
-        mock_popen.return_value = mock.Mock(stdout=SYSBENCH_OUTPUT)
+        mock_popen.return_value = mock.Mock(
+            stdout=SYSBENCH_OUTPUT.encode().splitlines())
         mock_cpu_socket.return_value = range(2)
         mem.mem_perf(self.hw_data)
 
-        expected = [
-            ('cpu', 'logical', 'number', 2),
-            ('cpu', 'physical', 'number', 2),
-            ('cpu', 'logical_0', 'bandwidth_1K', '382'),
-            ('cpu', 'logical_0', 'bandwidth_4K', '382'),
-            ('cpu', 'logical_0', 'bandwidth_1M', '382'),
-            ('cpu', 'logical_0', 'bandwidth_16M', '382'),
-            ('cpu', 'logical_0', 'bandwidth_128M', '382'),
-            ('cpu', 'logical_0', 'bandwidth_1G', '382'),
-            ('cpu', 'logical_0', 'bandwidth_2G', '382'),
-            ('cpu', 'logical_1', 'bandwidth_1K', '382'),
-            ('cpu', 'logical_1', 'bandwidth_4K', '382'),
-            ('cpu', 'logical_1', 'bandwidth_1M', '382'),
-            ('cpu', 'logical_1', 'bandwidth_16M', '382'),
-            ('cpu', 'logical_1', 'bandwidth_128M', '382'),
-            ('cpu', 'logical_1', 'bandwidth_1G', '382'),
-            ('cpu', 'logical_1', 'bandwidth_2G', '382'),
-            ('cpu', 'logical', 'threaded_bandwidth_1K', '382'),
-            ('cpu', 'logical', 'threaded_bandwidth_4K', '382'),
-            ('cpu', 'logical', 'threaded_bandwidth_1M', '382'),
-            ('cpu', 'logical', 'threaded_bandwidth_16M', '382'),
-            ('cpu', 'logical', 'threaded_bandwidth_128M', '382'),
-            ('cpu', 'logical', 'threaded_bandwidth_1G', '382'),
-            ('cpu', 'logical', 'threaded_bandwidth_2G', '382'),
-            ('cpu', 'logical', 'forked_bandwidth_1K', '382'),
-            ('cpu', 'logical', 'forked_bandwidth_4K', '382'),
-            ('cpu', 'logical', 'forked_bandwidth_1M', '382'),
-            ('cpu', 'logical', 'forked_bandwidth_16M', '382'),
-            ('cpu', 'logical', 'forked_bandwidth_128M', '382'),
-            ('cpu', 'logical', 'forked_bandwidth_1G', '382'),
-            ('cpu', 'logical', 'forked_bandwidth_2G', '382')
-        ]
+        expected = EXPECTED_RESULT
+        self.assertEqual(sorted(expected), sorted(self.hw_data))
+
+    def test_mem_perf_text(self, mock_popen, mock_cpu_socket,
+                           mock_get_memory):
+        mock_get_memory.return_value = 123456789012
+        mock_popen.return_value = mock.Mock(
+            stdout=SYSBENCH_OUTPUT.splitlines())
+        mock_cpu_socket.return_value = range(2)
+        mem.mem_perf(self.hw_data)
+
+        expected = EXPECTED_RESULT
         self.assertEqual(sorted(expected), sorted(self.hw_data))
 
     def test_check_mem_size(self, mock_popen, mock_cpu_socket,
@@ -107,20 +122,47 @@ class TestBenchmarkMem(unittest.TestCase):
         for block_size in block_size_list:
             self.assertFalse(mem.check_mem_size(block_size, 2))
 
-    def test_run_sysbench_memory_forked(self, mock_popen, mock_cpu_socket,
-                                        mock_get_memory):
+    def test_run_sysbench_memory_forked_text(self, mock_popen, mock_cpu_socket,
+                                             mock_get_memory):
         mock_get_memory.return_value = 123456789012
-        mock_popen.return_value = mock.Mock(stdout=SYSBENCH_OUTPUT)
+        mock_popen.return_value = mock.Mock(
+            stdout=SYSBENCH_OUTPUT.splitlines())
 
         hw_data = []
         mem.run_sysbench_memory_forked(hw_data, 10, '1K', 2)
         self.assertEqual([('cpu', 'logical', 'forked_bandwidth_1K', '382')],
                          hw_data)
 
-    def test_run_sysbench_memory_threaded(self, mock_popen, mock_cpu_socket,
-                                          mock_get_memory):
+    def test_run_sysbench_memory_forked_bytes(self, mock_popen,
+                                              mock_cpu_socket,
+                                              mock_get_memory):
+        mock_get_memory.return_value = 123456789012
+        mock_popen.return_value = mock.Mock(
+            stdout=SYSBENCH_OUTPUT.encode().splitlines())
+
+        hw_data = []
+        mem.run_sysbench_memory_forked(hw_data, 10, '1K', 2)
+        self.assertEqual([('cpu', 'logical', 'forked_bandwidth_1K', '382')],
+                         hw_data)
+
+    def test_run_sysbench_memory_threaded_text(self, mock_popen,
+                                               mock_cpu_socket,
+                                               mock_get_memory):
+        mock_get_memory.return_value = 123456789012
+        mock_popen.return_value = mock.Mock(
+            stdout=SYSBENCH_OUTPUT.splitlines())
+
+        hw_data = []
+        mem.run_sysbench_memory_threaded(hw_data, 10, '1K', 2)
+        self.assertEqual([('cpu', 'logical', 'threaded_bandwidth_1K', '382')],
+                         hw_data)
+
+    def test_run_sysbench_memory_threaded_bytes(self, mock_popen,
+                                                mock_cpu_socket,
+                                                mock_get_memory):
         mock_get_memory.return_value = 123456789012
-        mock_popen.return_value = mock.Mock(stdout=SYSBENCH_OUTPUT)
+        mock_popen.return_value = mock.Mock(
+            stdout=SYSBENCH_OUTPUT.encode().splitlines())
 
         hw_data = []
         mem.run_sysbench_memory_threaded(hw_data, 10, '1K', 2)

pip install -e .
parse_log_pytest
requirements.txt
coverage>=3.6 discover python-subunit sphinx>=1.1.2 oslosphinx stestr>=2.0.0 testtools>=0.9.34 pylint>=1.4.2 mock pytest
apt-get update apt-get install -y bc findutils
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
astroid==2.11.7
attrs==22.2.0
autopage==0.5.2
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
cliff==3.10.1
cmd2==2.4.3
coverage==6.2
dill==0.3.4
discover==0.4.0
docutils==0.18.1
extras==1.0.0
fixtures==4.0.1
-e git+https://github.com/redhat-cip/hardware.git@210ba54bd3f18a1eb65a54e434b304f51b6b2a97#egg=hardware
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
ipaddress==1.0.23
isort==5.10.1
Jinja2==3.0.3
lazy-object-proxy==1.7.1
MarkupSafe==2.0.1
mccabe==0.7.0
mock==5.2.0
netaddr==0.10.1
numpy==1.19.5
oslosphinx==4.18.0
packaging==21.3
pandas==1.1.5
pbr==6.1.1
pexpect==4.9.0
platformdirs==2.4.0
pluggy==1.0.0
prettytable==2.5.0
ptyprocess==0.7.0
py==1.11.0
Pygments==2.14.0
pylint==2.13.9
pyparsing==3.1.4
pyperclip==1.9.0
pytest==7.0.1
python-dateutil==2.9.0.post0
python-subunit==1.4.2
pytz==2025.2
PyYAML==6.0.1
requests==2.27.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
stestr==4.1.0
stevedore==3.5.2
testtools==2.6.0
tomli==1.2.3
tomlkit==0.11.6
typed-ast==1.5.5
typing_extensions==4.1.1
urllib3==1.26.20
voluptuous==0.13.1
wcwidth==0.2.13
wrapt==1.16.0
zipp==3.6.0

name: hardware
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - astroid==2.11.7
      - attrs==22.2.0
      - autopage==0.5.2
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - cliff==3.10.1
      - cmd2==2.4.3
      - coverage==6.2
      - dill==0.3.4
      - discover==0.4.0
      - docutils==0.18.1
      - extras==1.0.0
      - fixtures==4.0.1
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - ipaddress==1.0.23
      - isort==5.10.1
      - jinja2==3.0.3
      - lazy-object-proxy==1.7.1
      - markupsafe==2.0.1
      - mccabe==0.7.0
      - mock==5.2.0
      - netaddr==0.10.1
      - numpy==1.19.5
      - oslosphinx==4.18.0
      - packaging==21.3
      - pandas==1.1.5
      - pbr==6.1.1
      - pexpect==4.9.0
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - prettytable==2.5.0
      - ptyprocess==0.7.0
      - py==1.11.0
      - pygments==2.14.0
      - pylint==2.13.9
      - pyparsing==3.1.4
      - pyperclip==1.9.0
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - python-subunit==1.4.2
      - pytz==2025.2
      - pyyaml==6.0.1
      - requests==2.27.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - stestr==4.1.0
      - stevedore==3.5.2
      - testtools==2.6.0
      - tomli==1.2.3
      - tomlkit==0.11.6
      - typed-ast==1.5.5
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - voluptuous==0.13.1
      - wcwidth==0.2.13
      - wrapt==1.16.0
      - zipp==3.6.0
prefix: /opt/conda/envs/hardware

hardware/tests/test_benchmark_mem.py::TestBenchmarkMem::test_mem_perf_bytes hardware/tests/test_benchmark_mem.py::TestBenchmarkMem::test_run_sysbench_memory_forked_bytes hardware/tests/test_benchmark_mem.py::TestBenchmarkMem::test_run_sysbench_memory_threaded_bytes
hardware/tests/test_benchmark_mem.py::TestBenchmarkMem::test_check_mem_size hardware/tests/test_benchmark_mem.py::TestBenchmarkMem::test_mem_perf_text hardware/tests/test_benchmark_mem.py::TestBenchmarkMem::test_run_sysbench_memory_forked_text hardware/tests/test_benchmark_mem.py::TestBenchmarkMem::test_run_sysbench_memory_threaded_text
hardware/benchmark/mem.py
hardware/benchmark/mem.py