# Generating a mock artifact

**URL:** https://hub.mender.io/t/generating-a-mock-artifact/5016
**Category:** General Discussions
**Created:** [June 13, 2022, 3:42am UTC](https://hub.mender.io/t/generating-a-mock-artifact/5016 "2022-06-13T03:42:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![SuicidalLabRat](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/suicidallabrat/32/311_2.png) [@SuicidalLabRat](https://hub.mender.io/u/SuicidalLabRat)
#### Post date: [June 13, 2022, 3:42am UTC](https://hub.mender.io/t/generating-a-mock-artifact/5016/1 "2022-06-13T03:42:22Z")

</div>

**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-

---

<div class="post-metadata">

### Author: ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)
#### Post date: [June 13, 2022, 8:22am UTC](https://hub.mender.io/t/generating-a-mock-artifact/5016/2 "2022-06-13T08:22:41Z")

</div>

> [@SuicidalLabRat](#):
>
> **Q.** _Is it possible to generate an artifact with no actual image payload?_

Not currently, but it’s possible [this may be implemented quite soon](https://tracker.mender.io/browse/MEN-2586), since we need it for some other related functionality as well.

> [@SuicidalLabRat](#):
>
> **Q.** _…a small dummy payload?_

Yes, in the meantime, just use a `single-file` Artifact, with a zero-byte `/tmp/dummy` file. See [this post](https://hub.mender.io/t/single-file/486) for more information.

---

<div class="post-metadata">

### Author: ![SuicidalLabRat](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/suicidallabrat/32/311_2.png) [@SuicidalLabRat](https://hub.mender.io/u/SuicidalLabRat)
#### Post date: [June 13, 2022, 8:45am UTC](https://hub.mender.io/t/generating-a-mock-artifact/5016/3 "2022-06-13T08:45:41Z")

</div>

@kacf Im starting to get tired of calling you a rockstar 😉  
…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-

---

<div class="post-metadata">

### Author: ![SuicidalLabRat](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/suicidallabrat/32/311_2.png) [@SuicidalLabRat](https://hub.mender.io/u/SuicidalLabRat)
#### Post date: [June 13, 2022, 9:05pm UTC](https://hub.mender.io/t/generating-a-mock-artifact/5016/4 "2022-06-13T21:05:06Z")

</div>

> [@kacf](#):
>
> `single-file` Artifact

@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-

---

<div class="post-metadata">

### Author: ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)
#### Post date: [June 14, 2022, 7:34am UTC](https://hub.mender.io/t/generating-a-mock-artifact/5016/5 "2022-06-14T07:34:11Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

### Author: ![SuicidalLabRat](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/suicidallabrat/32/311_2.png) [@SuicidalLabRat](https://hub.mender.io/u/SuicidalLabRat)
#### Post date: [June 15, 2022, 5:04am UTC](https://hub.mender.io/t/generating-a-mock-artifact/5016/6 "2022-06-15T05:04:30Z")

</div>

@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-
