Skip to content

Commit

Permalink
Applied updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Nov 19, 2023
1 parent aa2af5c commit 832e019
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 63 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,6 @@ name: build
on: [push, pull_request]
permissions: read-all
jobs:
build_freebsd:
# FreeBSD support is provided via virtualization on MacOS 12
# See https://github.com/vmactions/freebsd-vm#under-the-hood.
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Building from source
id: build_freebsd
uses: vmactions/freebsd-vm@v0
with:
usesh: true
mem: 4096
# Note that the test scripts require bash
prepare: |
pkg install -y autoconf automake bash byacc flex fusefs-libs gettext git libtool openssl pkgconf
run: |
tests/build.sh
tests/runtests.sh
build_ubuntu:
runs-on: ubuntu-22.04
strategy:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/build_freebsd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Build from source on FreeBSD.
name: build_freebsd
on: [push]
permissions: read-all
jobs:
build_freebsd:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Building from source
id: build_freebsd
uses: vmactions/freebsd-vm@v1
with:
usesh: true
mem: 4096
# Note that the test scripts require bash
prepare: |
pkg install -y autoconf automake bash byacc flex fusefs-libs gettext git libtool openssl pkgconf
run: |
tests/build.sh
tests/runtests.sh
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ install:
.\builddokan.ps1 -Configuration ${Configuration} -Platform "x64"; }
}
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q gettext gnu-sed || true; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q autoconf automake gettext gnu-sed libtool macfuse openssl pkg-config || true; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi
- cmd: if [%BUILD_ENVIRONMENT%]==[python] (
"%PYTHON%" -m pip install -U pip setuptools twine wheel )
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.71])

AC_INIT(
[libewf],
[20231028],
[20231119],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
Expand Down
6 changes: 3 additions & 3 deletions ewftools/ewftools_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void (*ewftools_signal_signal_handler)( ewftools_signal_t ) = NULL;
/* Signal handler for Ctrl+C or Ctrl+Break signals
*/
BOOL WINAPI ewftools_signal_handler(
unsigned long signal )
ewftools_signal_t signal )
{
static char *function = "ewftools_signal_handler";

Expand Down Expand Up @@ -112,7 +112,7 @@ int ewftools_signal_attach(
ewftools_signal_signal_handler = signal_handler;

if( SetConsoleCtrlHandler(
ewftools_signal_handler,
(PHANDLER_ROUTINE) ewftools_signal_handler,
TRUE ) == 0 )
{
libcerror_error_set(
Expand Down Expand Up @@ -179,7 +179,7 @@ int ewftools_signal_detach(
static char *function = "ewftools_signal_detach";

if( SetConsoleCtrlHandler(
ewftools_signal_handler,
(PHANDLER_ROUTINE) ewftools_signal_handler,
FALSE ) == 0 )
{
libcerror_error_set(
Expand Down
15 changes: 0 additions & 15 deletions setup.cfg

This file was deleted.

44 changes: 22 additions & 22 deletions tests/pyewf_test_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_signal_abort(self):

def test_open(self):
"""Tests the open function."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -60,7 +60,7 @@ def test_open(self):

def test_open_file_objects(self):
"""Tests the open_file_objects function."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand Down Expand Up @@ -88,7 +88,7 @@ def test_open_file_objects(self):

def test_close(self):
"""Tests the close function."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -100,7 +100,7 @@ def test_close(self):

def test_open_close(self):
"""Tests the open and close functions."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
return

Expand Down Expand Up @@ -134,7 +134,7 @@ def test_open_close(self):

def test_read_buffer(self):
"""Tests the read_buffer function."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand Down Expand Up @@ -215,7 +215,7 @@ def test_read_buffer(self):

def test_read_buffer_file_object(self):
"""Tests the read_buffer function on a file-like object."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -239,7 +239,7 @@ def test_read_buffer_file_object(self):

def test_read_buffer_at_offset(self):
"""Tests the read_buffer_at_offset function."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand Down Expand Up @@ -309,7 +309,7 @@ def test_read_buffer_at_offset(self):

def test_seek_offset(self):
"""Tests the seek_offset function."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand Down Expand Up @@ -371,7 +371,7 @@ def test_seek_offset(self):

def test_seek_offset_file_object(self):
"""Tests the seek_offset function on a file-like object."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -395,7 +395,7 @@ def test_seek_offset_file_object(self):

def test_get_offset(self):
"""Tests the get_offset function."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -412,7 +412,7 @@ def test_get_offset(self):

def test_get_root_file_entry(self):
"""Tests the get_root_file_entry function and root_file_entry property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -433,7 +433,7 @@ def test_get_root_file_entry(self):

def test_get_sectors_per_chunk(self):
"""Tests the get_sectors_per_chunk function and sectors_per_chunk property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -452,7 +452,7 @@ def test_get_sectors_per_chunk(self):

def test_get_bytes_per_sector(self):
"""Tests the get_bytes_per_sector function and bytes_per_sector property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -471,7 +471,7 @@ def test_get_bytes_per_sector(self):

def test_get_number_of_sectors(self):
"""Tests the get_number_of_sectors function and number_of_sectors property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -490,7 +490,7 @@ def test_get_number_of_sectors(self):

def test_get_chunk_size(self):
"""Tests the get_chunk_size function and chunk_size property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -509,7 +509,7 @@ def test_get_chunk_size(self):

def test_get_error_granularity(self):
"""Tests the get_error_granularity function and error_granularity property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -528,7 +528,7 @@ def test_get_error_granularity(self):

def test_get_compression_method(self):
"""Tests the get_compression_method function and compression_method property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -547,7 +547,7 @@ def test_get_compression_method(self):

def test_get_media_size(self):
"""Tests the get_media_size function and media_size property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -566,7 +566,7 @@ def test_get_media_size(self):

def test_get_media_type(self):
"""Tests the get_media_type function and media_type property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -585,7 +585,7 @@ def test_get_media_type(self):

def test_get_media_flags(self):
"""Tests the get_media_flags function and media_flags property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -604,7 +604,7 @@ def test_get_media_flags(self):

def test_get_format(self):
"""Tests the get_format function and format property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -623,7 +623,7 @@ def test_get_format(self):

def test_get_header_codepage(self):
"""Tests the get_header_codepage function and header_codepage property."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand Down
7 changes: 5 additions & 2 deletions tests/pyewf_test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_get_version(self):

def test_check_file_signature(self):
"""Tests the check_file_signature function."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

Expand All @@ -46,10 +46,13 @@ def test_check_file_signature(self):

def test_check_file_signature_file_object(self):
"""Tests the check_file_signature_file_object function."""
test_source = unittest.source
test_source = getattr(unittest, "source", None)
if not test_source:
raise unittest.SkipTest("missing source")

if not os.path.isfile(test_source):
raise unittest.SkipTest("source not a regular file")

with open(test_source, "rb") as file_object:
result = pyewf.check_file_signature_file_object(file_object)
self.assertTrue(result)
Expand Down
5 changes: 4 additions & 1 deletion tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Script to run Python test scripts.
#
# Version: 20231009
# Version: 20231024

import glob
import os
Expand Down Expand Up @@ -70,6 +70,9 @@ def ReadIgnoreList(test_profile):
if lines[0] == "# libyal test data options":
for line in lines[1:]:
key, value = line.split("=", maxsplit=1)
if key == 'offset':
value = int(value)

setattr(unittest, key, value)

test_results = test_runner.run(test_scripts)
Expand Down

0 comments on commit 832e019

Please sign in to comment.