Commit Graph

139 Commits

Author SHA1 Message Date
Iustin Pop
a684fe5a15 Fix the release-tag makefile command
The tags are no longer named `mt-st-xxx`, but simply `v-xxx`. Also
remove the punctuation at the end of the message, since this is
similar to the commit subject.
2025-02-08 21:25:31 +01:00
Iustin Pop
70b24634cf Release version 1.8 2025-02-08 21:22:48 +01:00
Iustin Pop
a76e4ce544 Update changelog for the upcoming release 2025-02-08 21:19:20 +01:00
Iustin Pop
26392d9ae4 Commit vscode settings
These are trivial, but in the future more might be configured centrally.
2025-02-08 21:18:28 +01:00
Iustin Pop
1a074e2c65 Fix wildcard in data files to include all files in data/
This is not very nice, but calling all files `*.data` is superfluous
since they're already in a data file directory.
2025-01-07 22:02:26 +01:00
Iustin Pop
ba46d54458 Add a few more test for error paths
Since there's no virtual tape device, we can only test error paths,
sadly.
2025-01-07 21:53:22 +01:00
Iustin Pop
d4c8e67be0 Change coverage file to align better with vscode plugin
The coverage gutters plugin expects, by default, `lcov.info`, so let's
use that to require less customisation.
2025-01-07 21:20:15 +01:00
Iustin Pop
e14e9af952 Upgrade the codecov action to v5
And also add the token for uploading, as the last
commit ran into rate ACLs. Note entirely sure
about arguments, let's see.
2025-01-07 21:08:10 +01:00
Chris Dinneen
32fba27f78 Update auto completion to suggest stoptions where relevant 2025-01-07 17:04:45 +01:00
Chris Dinneen
aa6539b4b1 Fix Bash Completion: stshowopt isnt a valid choice 2025-01-07 17:04:45 +01:00
Kai Mäkisara
0c7307cc7a Add new density codes for IBM 3592 drives
Codes are added for the newer drives. The TS11xx names are added to
the desciptions of codes for non-encrypted tape.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
2025-01-07 16:29:51 +01:00
Iustin Pop
72d53ae798 Upgrade the CodeQL action to v2
The v1 was deprecated 2 years ago…
2025-01-05 17:02:06 +01:00
Iustin Pop
b11887d9b4 No-op reformat of the workflow files
Not sure why, but my editor wants this formatting. I won't fight it…
2025-01-05 16:59:18 +01:00
Iustin Pop
459ab4775b Allow manual workflow runs
Turns out, both CI and CodeQL were disabled due to lack of activity,
so all the recent pushes were not tested. Allow manual runs for such
cases i the future.
2025-01-05 16:56:31 +01:00
Chris Dinneen
85738cedc1 Add 3480 too 2025-01-05 16:47:40 +01:00
Chris Dinneen
82d569b489 add 3490E to tape type for code 0x09 2025-01-05 16:47:40 +01:00
Chris Dinneen
547bc649a9 Add 9track Reels to tape struct densities table 2025-01-05 16:43:49 +01:00
Chris Dinneen
5ec6428297 Fix Typo comprssed -> compressed 2025-01-05 16:41:12 +01:00
Iustin Pop
7aa498640d Add source link in the actual comments 2025-01-05 16:39:16 +01:00
Chris Dinneen
ba594d1e78 Add abbreviation explainer for tape types in code comment 2025-01-05 16:39:16 +01:00
Iustin Pop
e6f79d85ec Re-format code via clang-format
Technically, via `make reindent` :)
2025-01-05 16:27:41 +01:00
Kai Mäkisara
42dd44bb90 stinit: Change stinit to return one if setting one or more options fails
Previously, stinit returned zero even if it fails to set the options.
This patch changes the return value to one if one or more of the options
can't be set for a device if the tape numbers are given on command line.
If no numbers are given, stinit returns zero (as before this patch).
After this change, scripts (udev rules) can more easily detect when
stinit fails.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
2025-01-05 16:26:21 +01:00
Kai Mäkisara
ff108770be mt: stinit: Add support for setting and clearing MT_ST_NOWAIT_EOF
Add code to set/clear the MT_ST_NO_WAIT option bit for MTSETDRVBUFFER.
The string used in the user interface is 'weof-no-wait'.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
2025-01-05 14:54:06 +01:00
Kai Mäkisara
9c8f170d4a mt: Complain about write protection if write protected
Print the message if status bit is one, not zero.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
2024-12-14 18:28:43 +01:00
Chris Dinneen
72f9eda87d Backport Linux Kernel WEOFI ioctls 2023-11-04 10:06:45 +01:00
Chris Dinneen
eadc992f2a Fix #26; Add LTO9 Density Code 2023-10-31 17:57:47 +01:00
Iustin Pop
e8e6d543de Release version 1.7 v1.7 2023-04-20 23:23:56 +02:00
Iustin Pop
34978b4019 Fix a 25-year old bug \o/
This is a trivial bug, but a bug nevertheless. It's present in the
first commit in this (synthetic) Git repository, and from my
investigations into very old versions - mt-st-0.5 from an old RedHat
version - it was already present in the `stinit.c` version from Apr
11, 1998, which makes it 25 years and 9 days old. This is a new record
for me, which I don't think I'll beat :)

The bug is trivial, in retrospect, and was found just by accident
because with the 1.6 release uploaded in Debian, the new test suite is
run on multiple architectures. While amd64/x86 doesn't trigger this
bug in neither '-O2' nor '-g' build, mips64el, arm64, and s390x do
show the bug in the optimised builds (and only in them) as follows:

amd64:

```
$ /sbin/stinit -v -v -v -p -f ./tests/data/bad-definition.data

Parsing modes for ('XYZ', 'UVW1', '').
Mode 1 definition:  blocksize=
Warning: errors in definition for ('XYZ', 'UVW1', ''):
 blocksize=

Definition parse completed. Errors found!
```

s390x:

```
$ ./stinit -p -v -v -v -f tests/data/bad-definition.data

Parsing modes for ('XYZ', 'UVW1', '').
Mode 1 definition:  blocksize=
Warning: errors in definition for ('XYZ', 'UVW1', ''):
 �H

Definition parse completed. Errors found!
```

And shelltest fails to parse that binary output, in 4/5 cases, which
by luck caused the builds to fail. From there it was a fun
investigation into trying to find why it behaves like that.

This bug is caught by the recently introduced MSAN build in the GitHub
CI, so will rely less on luck in the future.

I'm not 100% sure on the semantics of the fix, but it should only
affect this case (missing value to argument), so should be a well
localised fix.

Signed-off-by: Iustin Pop <iustin@k1024.org>
2023-04-20 23:18:23 +02:00
Iustin Pop
8056c1542a Fix CFLAGS for sanitizer
Oops, didn't fail as expected :)
2023-04-20 23:04:14 +02:00
Iustin Pop
c36a4a0fa5 Don't run undefined (UBSAN) on top of MSAN 2023-04-20 23:03:46 +02:00
Iustin Pop
f9c0570e34 Run tests under various sanitizers
This is in preparation for the next commit which will fix a very long
standing bug…
2023-04-20 23:01:20 +02:00
Iustin Pop
aec3bd67f6 CI workflow: install dependencies for the test jobs too
shelltestrunner was already installed for the coverage target, but not
for main test ones (for the same reason that release 1.5 was broken,
in the sense that it was not needed…).
v1.6
2023-04-19 23:39:12 +02:00
Iustin Pop
52a6c218b9 Release bugfix version 1.6 😅 2023-04-19 23:33:02 +02:00
Iustin Pop
4a72962872 Finish the test migration to shelltest
The shelltest migration was done in 1.4, but not completed - the
distcheck was still doing hard-coded manual tests, and as such, the
"check" target from the dist archive was not working. Sigh.

Now 'distcheck' is using 'check', and the archive is complete.
2023-04-19 23:29:58 +02:00
Iustin Pop
c49c863a2a Release version 1.5 v1.5 2023-04-19 22:59:23 +02:00
Iustin Pop
b6d221c17a Add a few more stinit parsing tests 2023-04-18 22:14:18 +02:00
Iustin Pop
e96400b602 Make sure that make clean removes coverage info
I spent 20 minutes trying to understand why lcov/gcov were complaining
about wrong coverage format/version, before I saw I had a 2 year old
file that was not overwritten nor removed…
2023-04-18 21:34:04 +02:00
Iustin Pop
3c537a17e2 Modernise the CI workflow
Switch to more recent versions of the checkout and codecov action, the
latter also removing saving the data locally, so remove the archival
of that data.
2023-04-18 20:47:08 +02:00
Iustin Pop
bd3b8539d1 Fixup workflows after master->main rename 2023-04-18 20:43:05 +02:00
Iustin Pop
07e9cd2653 Fix build status badge and add a couple more 2023-04-18 20:41:52 +02:00
Iustin Pop
1dafc02c2e Merge pull request #25 from dabiged/Add_3590
Add IBM 3590 B/E format to tape densities table
2023-03-17 13:09:46 +01:00
Chris Dinneen
d7e60146d2 Add: 3590 B using same syntax as T10000A 2023-02-07 12:17:14 +08:00
Chris Dinneen
4fdbc29fed Add IBM 3590 E format to tape list 2023-01-09 11:35:11 +08:00
Iustin Pop
fbfd923faa Expand command line and error handling 2021-06-06 02:34:24 +02:00
Iustin Pop
886ce1f261 Switch 'make check' to be done via shelltestrunner
The embedding of tests in the Makefile works only for that is there
today - a few `--version` and `stinit -p` calls. For expanding the
test coverage, as much as it can be done for `mt`, let's use a proper
shell test runner. `shelltestrunner` is available in Debian/Ubuntu, so
it's likely to be available in other distributions too, and as such
should not be a big barrier to contribution.
2021-06-06 01:46:03 +02:00
Iustin Pop
1743522b8a Add a local coverage target
This needs lcov installed, but it's a good quick helper for local
runs. For history and pull requests, codecov keeps tracking.

Also tweak in the process gitignore to clean the noise.
2021-06-06 00:11:35 +02:00
Iustin Pop
c33c6ad43e Update README badges
Switch from travis-ci to github workflows, and add codecov badge.
2021-06-06 00:03:35 +02:00
Iustin Pop
51b0d3da23 Remove travis config file 2021-06-05 23:51:41 +02:00
Iustin Pop
3241491f72 CI: Add coverage job and upload to codecov 2021-06-05 23:51:01 +02:00
Iustin Pop
5a88467b88 Create a make check target
This is the exact same mini-"tests" that are used in distcheck, but
separated so that the tests can be run with coverage tracking. Would
be good not to have duplicates - maybe use make check inside the
distcheck?
2021-06-05 23:41:47 +02:00