From c21c2555d6b63012fae5e89d54f3e29e08011771 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 26 Apr 2022 21:02:53 +0200 Subject: [PATCH] Onboard package into gating --- .fmf/version | 1 + gating.yaml | 8 ++++++++ plans/Smoke.java | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ plans/smoke.fmf | 8 ++++++++ 4 files changed, 68 insertions(+) create mode 100644 .fmf/version create mode 100644 gating.yaml create mode 100644 plans/Smoke.java create mode 100644 plans/smoke.fmf diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..05d1cc5 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,8 @@ +--- !Policy +product_versions: + - fedora-* +decision_contexts: + - bodhi_update_push_testing + - bodhi_update_push_stable +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/plans/Smoke.java b/plans/Smoke.java new file mode 100644 index 0000000..64fa8f7 --- /dev/null +++ b/plans/Smoke.java @@ -0,0 +1,51 @@ +import com.lmax.disruptor.dsl.Disruptor; +import com.lmax.disruptor.EventFactory; +import com.lmax.disruptor.RingBuffer; +import com.lmax.disruptor.util.DaemonThreadFactory; +import java.nio.ByteBuffer; + +class LongEvent +{ + private long value; + + public void set(long value) + { + this.value = value; + } +} + +class LongEventFactory implements EventFactory +{ + public LongEvent newInstance() + { + return new LongEvent(); + } +} + +public class Smoke +{ + public static void main(String[] args) throws Exception + { + System.out.println("SMOKE TEST START"); + + int bufferSize = 1024; + + Disruptor disruptor = + new Disruptor<>(LongEvent::new, bufferSize, DaemonThreadFactory.INSTANCE); + + disruptor.handleEventsWith((event, sequence, endOfBatch) -> + System.out.println("Event: " + event)); + disruptor.start(); + + RingBuffer ringBuffer = disruptor.getRingBuffer(); + ByteBuffer bb = ByteBuffer.allocate(8); + for (long l = 0; l < 10; l++) + { + bb.putLong(0, l); + ringBuffer.publishEvent((event, sequence, buffer) -> event.set(buffer.getLong(0)), bb); + Thread.sleep(100); + } + + System.out.println("SMOKE TEST COMPLETE"); + } +} diff --git a/plans/smoke.fmf b/plans/smoke.fmf new file mode 100644 index 0000000..6b39f3b --- /dev/null +++ b/plans/smoke.fmf @@ -0,0 +1,8 @@ +summary: Basic smoke test +prepare: + how: install + package: java-1.8.0-openjdk-devel +execute: + script: + - /usr/lib/jvm/java-1.8.0-openjdk/bin/javac -cp /usr/share/java/disruptor.jar plans/Smoke.java + - /usr/lib/jvm/java-1.8.0-openjdk/bin/java -cp /usr/share/java/disruptor.jar:plans Smoke