Skip to content

Commit 832e019

Browse files
committed
Applied updates
1 parent aa2af5c commit 832e019

9 files changed

Lines changed: 57 additions & 63 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,6 @@ name: build
33
on: [push, pull_request]
44
permissions: read-all
55
jobs:
6-
build_freebsd:
7-
# FreeBSD support is provided via virtualization on MacOS 12
8-
# See https://github.com/vmactions/freebsd-vm#under-the-hood.
9-
runs-on: macos-12
10-
steps:
11-
- uses: actions/checkout@v3
12-
- name: Building from source
13-
id: build_freebsd
14-
uses: vmactions/freebsd-vm@v0
15-
with:
16-
usesh: true
17-
mem: 4096
18-
# Note that the test scripts require bash
19-
prepare: |
20-
pkg install -y autoconf automake bash byacc flex fusefs-libs gettext git libtool openssl pkgconf
21-
run: |
22-
tests/build.sh
23-
tests/runtests.sh
246
build_ubuntu:
257
runs-on: ubuntu-22.04
268
strategy:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Build from source on FreeBSD.
2+
name: build_freebsd
3+
on: [push]
4+
permissions: read-all
5+
jobs:
6+
build_freebsd:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Building from source
11+
id: build_freebsd
12+
uses: vmactions/freebsd-vm@v1
13+
with:
14+
usesh: true
15+
mem: 4096
16+
# Note that the test scripts require bash
17+
prepare: |
18+
pkg install -y autoconf automake bash byacc flex fusefs-libs gettext git libtool openssl pkgconf
19+
run: |
20+
tests/build.sh
21+
tests/runtests.sh

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ install:
247247
.\builddokan.ps1 -Configuration ${Configuration} -Platform "x64"; }
248248
}
249249
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi
250-
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q gettext gnu-sed || true; fi
250+
- 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
251251
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi
252252
- cmd: if [%BUILD_ENVIRONMENT%]==[python] (
253253
"%PYTHON%" -m pip install -U pip setuptools twine wheel )

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AC_PREREQ([2.71])
22

33
AC_INIT(
44
[libewf],
5-
[20231028],
5+
[20231119],
66
[joachim.metz@gmail.com])
77

88
AC_CONFIG_SRCDIR(

ewftools/ewftools_signal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void (*ewftools_signal_signal_handler)( ewftools_signal_t ) = NULL;
4040
/* Signal handler for Ctrl+C or Ctrl+Break signals
4141
*/
4242
BOOL WINAPI ewftools_signal_handler(
43-
unsigned long signal )
43+
ewftools_signal_t signal )
4444
{
4545
static char *function = "ewftools_signal_handler";
4646

@@ -112,7 +112,7 @@ int ewftools_signal_attach(
112112
ewftools_signal_signal_handler = signal_handler;
113113

114114
if( SetConsoleCtrlHandler(
115-
ewftools_signal_handler,
115+
(PHANDLER_ROUTINE) ewftools_signal_handler,
116116
TRUE ) == 0 )
117117
{
118118
libcerror_error_set(
@@ -179,7 +179,7 @@ int ewftools_signal_detach(
179179
static char *function = "ewftools_signal_detach";
180180

181181
if( SetConsoleCtrlHandler(
182-
ewftools_signal_handler,
182+
(PHANDLER_ROUTINE) ewftools_signal_handler,
183183
FALSE ) == 0 )
184184
{
185185
libcerror_error_set(

setup.cfg

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/pyewf_test_handle.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_signal_abort(self):
3939

4040
def test_open(self):
4141
"""Tests the open function."""
42-
test_source = unittest.source
42+
test_source = getattr(unittest, "source", None)
4343
if not test_source:
4444
raise unittest.SkipTest("missing source")
4545

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

6161
def test_open_file_objects(self):
6262
"""Tests the open_file_objects function."""
63-
test_source = unittest.source
63+
test_source = getattr(unittest, "source", None)
6464
if not test_source:
6565
raise unittest.SkipTest("missing source")
6666

@@ -88,7 +88,7 @@ def test_open_file_objects(self):
8888

8989
def test_close(self):
9090
"""Tests the close function."""
91-
test_source = unittest.source
91+
test_source = getattr(unittest, "source", None)
9292
if not test_source:
9393
raise unittest.SkipTest("missing source")
9494

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

101101
def test_open_close(self):
102102
"""Tests the open and close functions."""
103-
test_source = unittest.source
103+
test_source = getattr(unittest, "source", None)
104104
if not test_source:
105105
return
106106

@@ -134,7 +134,7 @@ def test_open_close(self):
134134

135135
def test_read_buffer(self):
136136
"""Tests the read_buffer function."""
137-
test_source = unittest.source
137+
test_source = getattr(unittest, "source", None)
138138
if not test_source:
139139
raise unittest.SkipTest("missing source")
140140

@@ -215,7 +215,7 @@ def test_read_buffer(self):
215215

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

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

240240
def test_read_buffer_at_offset(self):
241241
"""Tests the read_buffer_at_offset function."""
242-
test_source = unittest.source
242+
test_source = getattr(unittest, "source", None)
243243
if not test_source:
244244
raise unittest.SkipTest("missing source")
245245

@@ -309,7 +309,7 @@ def test_read_buffer_at_offset(self):
309309

310310
def test_seek_offset(self):
311311
"""Tests the seek_offset function."""
312-
test_source = unittest.source
312+
test_source = getattr(unittest, "source", None)
313313
if not test_source:
314314
raise unittest.SkipTest("missing source")
315315

@@ -371,7 +371,7 @@ def test_seek_offset(self):
371371

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

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

396396
def test_get_offset(self):
397397
"""Tests the get_offset function."""
398-
test_source = unittest.source
398+
test_source = getattr(unittest, "source", None)
399399
if not test_source:
400400
raise unittest.SkipTest("missing source")
401401

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

413413
def test_get_root_file_entry(self):
414414
"""Tests the get_root_file_entry function and root_file_entry property."""
415-
test_source = unittest.source
415+
test_source = getattr(unittest, "source", None)
416416
if not test_source:
417417
raise unittest.SkipTest("missing source")
418418

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

434434
def test_get_sectors_per_chunk(self):
435435
"""Tests the get_sectors_per_chunk function and sectors_per_chunk property."""
436-
test_source = unittest.source
436+
test_source = getattr(unittest, "source", None)
437437
if not test_source:
438438
raise unittest.SkipTest("missing source")
439439

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

453453
def test_get_bytes_per_sector(self):
454454
"""Tests the get_bytes_per_sector function and bytes_per_sector property."""
455-
test_source = unittest.source
455+
test_source = getattr(unittest, "source", None)
456456
if not test_source:
457457
raise unittest.SkipTest("missing source")
458458

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

472472
def test_get_number_of_sectors(self):
473473
"""Tests the get_number_of_sectors function and number_of_sectors property."""
474-
test_source = unittest.source
474+
test_source = getattr(unittest, "source", None)
475475
if not test_source:
476476
raise unittest.SkipTest("missing source")
477477

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

491491
def test_get_chunk_size(self):
492492
"""Tests the get_chunk_size function and chunk_size property."""
493-
test_source = unittest.source
493+
test_source = getattr(unittest, "source", None)
494494
if not test_source:
495495
raise unittest.SkipTest("missing source")
496496

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

510510
def test_get_error_granularity(self):
511511
"""Tests the get_error_granularity function and error_granularity property."""
512-
test_source = unittest.source
512+
test_source = getattr(unittest, "source", None)
513513
if not test_source:
514514
raise unittest.SkipTest("missing source")
515515

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

529529
def test_get_compression_method(self):
530530
"""Tests the get_compression_method function and compression_method property."""
531-
test_source = unittest.source
531+
test_source = getattr(unittest, "source", None)
532532
if not test_source:
533533
raise unittest.SkipTest("missing source")
534534

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

548548
def test_get_media_size(self):
549549
"""Tests the get_media_size function and media_size property."""
550-
test_source = unittest.source
550+
test_source = getattr(unittest, "source", None)
551551
if not test_source:
552552
raise unittest.SkipTest("missing source")
553553

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

567567
def test_get_media_type(self):
568568
"""Tests the get_media_type function and media_type property."""
569-
test_source = unittest.source
569+
test_source = getattr(unittest, "source", None)
570570
if not test_source:
571571
raise unittest.SkipTest("missing source")
572572

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

586586
def test_get_media_flags(self):
587587
"""Tests the get_media_flags function and media_flags property."""
588-
test_source = unittest.source
588+
test_source = getattr(unittest, "source", None)
589589
if not test_source:
590590
raise unittest.SkipTest("missing source")
591591

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

605605
def test_get_format(self):
606606
"""Tests the get_format function and format property."""
607-
test_source = unittest.source
607+
test_source = getattr(unittest, "source", None)
608608
if not test_source:
609609
raise unittest.SkipTest("missing source")
610610

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

624624
def test_get_header_codepage(self):
625625
"""Tests the get_header_codepage function and header_codepage property."""
626-
test_source = unittest.source
626+
test_source = getattr(unittest, "source", None)
627627
if not test_source:
628628
raise unittest.SkipTest("missing source")
629629

tests/pyewf_test_support.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_get_version(self):
3737

3838
def test_check_file_signature(self):
3939
"""Tests the check_file_signature function."""
40-
test_source = unittest.source
40+
test_source = getattr(unittest, "source", None)
4141
if not test_source:
4242
raise unittest.SkipTest("missing source")
4343

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

4747
def test_check_file_signature_file_object(self):
4848
"""Tests the check_file_signature_file_object function."""
49-
test_source = unittest.source
49+
test_source = getattr(unittest, "source", None)
5050
if not test_source:
5151
raise unittest.SkipTest("missing source")
5252

53+
if not os.path.isfile(test_source):
54+
raise unittest.SkipTest("source not a regular file")
55+
5356
with open(test_source, "rb") as file_object:
5457
result = pyewf.check_file_signature_file_object(file_object)
5558
self.assertTrue(result)

tests/runtests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Script to run Python test scripts.
44
#
5-
# Version: 20231009
5+
# Version: 20231024
66

77
import glob
88
import os
@@ -70,6 +70,9 @@ def ReadIgnoreList(test_profile):
7070
if lines[0] == "# libyal test data options":
7171
for line in lines[1:]:
7272
key, value = line.split("=", maxsplit=1)
73+
if key == 'offset':
74+
value = int(value)
75+
7376
setattr(unittest, key, value)
7477

7578
test_results = test_runner.run(test_scripts)

0 commit comments

Comments
 (0)