Generating a mock artifact

Q. Is it possible to generate an artifact with no actual image payload?
Q. …a small dummy payload?

Our CI environment, as well as our DVT/PVT lab, would benefit from the ability to deploy a ‘mock’ artifact to test units.
The intention would be to generate the smallest possible artifact, whos only functionality would be to deploy an ArtifactInstall_Enter state-script that would publish a status message to the CI servers.
This state-script would be designed to always exit >0, aborting the installation (we dont want to install a new image in this test environment); so, we would prefer not wasting the time/cellular data-cost of transporting an actual installable image along with the artifact.

SLR-

Not currently, but it’s possible this may be implemented quite soon, since we need it for some other related functionality as well.

Yes, in the meantime, just use a single-file Artifact, with a zero-byte /tmp/dummy file. See this post for more information.

@kacf Im starting to get tired of calling you a rockstar :wink:
…sadly, it looks like that solution requires the preexistence of an update module on the OTA client, which we cant currently accommodate, since most of our lab is a reflection of our currently deployed fleet - none of which have ‘update’ modules; or any modules, for that matter.

SLR-

@kacf Has the mender-artifact “–script” switch been deprecated? I dont seem to be able to add a state-script to an artifact with single-file-artifact-gen passthrough.

THNX!
SLR-

Have you used the -- separator? The generators are generally split like this:

single-file-artifact-gen <GENERATOR-OPTIONS> -- <MENDER-ARTIFACT-OPTIONS>

Many of them support some of the mender-artifact options also in the first set of options, for convenience, but not all.

@kacf Yeah, it was probably user error on my part. While I didnt see –script documented in the mender-artifact help, running unix strings on the binary revealed plenty of references to the functionality commented in the code.
At any rate, I gave up on that approach due to the module requirement, and decided to simply build a normal root filesystem type artifact to deploy my state scripts for testing. Despite doing it this way, I was able to bring the entire artifact size down to 9K, including 2 state scripts. Thats much smaller than I was planning for, and will make deploying significantly less expensive, in both time and data costs.

Anyway, I know I say it every time you respond to one of my posts, but I’ll say again; I really appreciate the guidance.

THNX!
SLR-

1 Like