Skip to content

Commit

Permalink
feat(cijoe): merge cijoe-pkg-* into cijoe
Browse files Browse the repository at this point in the history
Closes #61

Signed-off-by: Nadja Brix Koch <n.koch@samsung.com>
  • Loading branch information
NaddiNadja authored and safl committed Jun 12, 2024
1 parent 7d0a3e2 commit c5d5ecd
Show file tree
Hide file tree
Showing 53 changed files with 1,755 additions and 0 deletions.
Empty file added src/cijoe/fio/__init__.py
Empty file.
Empty file.
31 changes: 31 additions & 0 deletions src/cijoe/fio/configs/default-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Declaration of where fio is located on the test-target and which IO-engines it has available
[fio]
bin = "{{ local.env.HOME }}/opt/fio/bin/fio"

[fio.repository]
upstream = "https://github.com/axboe/fio.git"
path = "{{ local.env.HOME }}/git/fio"

[fio.build]
prefix = "{{ local.env.HOME }}/opt/fio"

[fio.engines.libaio]
type = "builtin"

[fio.engines.io_uring]
type = "builtin"

[fio.engines.io_uring_cmd]
type = "builtin"

[fio.engines.xnvme]
path = "/usr/local/lib/x86_64-linux-gnu/libxnvme-fio-engine.so"
type = "external_dynamic"

[fio.engines.spdk_nvme]
path = "/opt/aux/spdk_nvme"
type = "external_preload"

[fio.engines.spdk_bdev]
path = "/opt/aux/spdk_bdev"
type = "external_preload"
Empty file.
29 changes: 29 additions & 0 deletions src/cijoe/fio/scripts/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
"""
build fio
=========
Build fio in fio.repository.path, using prefix fio.build.prefix.
Retargetable: True
------------------
"""
from pathlib import Path


def main(args, cijoe, step):
"""Install qemu"""

commands = [
"make clean",
f"./configure --prefix={ cijoe.config.options['fio']['build']['prefix'] }",
"make -j $(nproc)",
]
for cmd in commands:
err, _ = cijoe.run(
cmd, cwd=Path(cijoe.config.options["fio"]["repository"]["path"])
)
if err:
return err

return err
20 changes: 20 additions & 0 deletions src/cijoe/fio/scripts/check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
"""
check fio
=========
Check the version of the wrapped fio. This is useful for reference and as a check that
fio-wrapper has the correct options set.
Retargetable: True
------------------
"""
from cijoe.fio.wrapper import fio


def main(args, cijoe, step):
"""Check version of fio"""

err, _ = fio(cijoe, "--help")

return err
20 changes: 20 additions & 0 deletions src/cijoe/fio/scripts/install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
"""
install fio
===========
Just a plain 'make install' within 'repository.path'
Retargetable: True
------------------
"""
from pathlib import Path


def main(args, cijoe, step):
"""Install fio"""

err, _ = cijoe.run(
"make install", cwd=Path(cijoe.config.options["fio"]["repository"]["path"])
)
return err
Empty file.
37 changes: 37 additions & 0 deletions src/cijoe/fio/selftest/test_fio_wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import cijoe.linux.null_blk as null_blk
import pytest

import cijoe.fio.wrapper as fio


def skip_when_config_has_no_remote(cijoe):
"""Skip testing when configuration is module not enabled"""

transport = cijoe.config.options.get("transport", None)
if not transport:
pytest.skip(reason="skipping as there is no remote transport defined")


def test_run(cijoe):

skip_when_config_has_no_remote(cijoe)

err, _ = null_blk.insert(cijoe)
assert not err

err, _ = fio.run(
cijoe,
[
"--filename",
"/dev/nullb0",
"--bs",
"4k",
"--rw",
"randread",
"--size",
"1G",
"--name",
"foo42",
],
)
assert not err
Empty file.
13 changes: 13 additions & 0 deletions src/cijoe/fio/workflows/example.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
doc: |
This workflow demonstrates how to use build and install fio via cijoe

steps:
- name: build
uses: fio.build

- name: install
uses: fio.install

- name: check
uses: fio.check
Loading

0 comments on commit c5d5ecd

Please sign in to comment.