diff --git a/tools/test/scenarios/smoke.xml b/tools/test/scenarios/smoke.xml
index 3161c21..21fd445 100644
--- a/tools/test/scenarios/smoke.xml
+++ b/tools/test/scenarios/smoke.xml
@@ -23,5 +23,5 @@
     <dependency name="Archetypes" requires="Setup"/>
 
     <import file="${ONOS_ROOT}/tools/test/scenarios/wrapup.xml"/>
-    <dependency name="Wrapup" requires="~Archetypes,Setup"/>
+    <dependency name="Wrapup" requires="~Archetypes,~Setup"/>
 </scenario>
diff --git a/utils/stc/src/main/java/org/onlab/stc/Coordinator.java b/utils/stc/src/main/java/org/onlab/stc/Coordinator.java
index 209de84..123ef7d 100644
--- a/utils/stc/src/main/java/org/onlab/stc/Coordinator.java
+++ b/utils/stc/src/main/java/org/onlab/stc/Coordinator.java
@@ -204,19 +204,20 @@
      */
     private synchronized void execute(Step step) {
         Directive directive = nextAction(step);
-        if (directive == RUN || directive == SKIP) {
+        if (directive == RUN) {
             store.markStarted(step);
             if (step instanceof Group) {
                 Group group = (Group) step;
                 delegate.onStart(group);
-                if (directive == RUN) {
-                    executeRoots(group);
-                } else {
-                    group.children().forEach(child -> delegate.onCompletion(child, 1));
-                }
+                executeRoots(group);
             } else {
-                executor.execute(new StepProcessor(step, directive == SKIP,
-                                                   logDir, delegate));
+                executor.execute(new StepProcessor(step, logDir, delegate));
+            }
+        } else if (directive == SKIP) {
+            if (step instanceof Group) {
+                Group group = (Group) step;
+                group.children().forEach(child -> delegate.onCompletion(child, SKIPPED));
+                delegate.onCompletion(step, SKIPPED);
             }
         }
     }
@@ -237,7 +238,8 @@
             Status depStatus = store.getStatus(dependency.dst());
             if (depStatus == WAITING || depStatus == IN_PROGRESS) {
                 return NOOP;
-            } else if (depStatus == FAILED && !dependency.isSoft()) {
+            } else if ((depStatus == FAILED || depStatus == SKIPPED) &&
+                    !dependency.isSoft()) {
                 return SKIP;
             }
         }
@@ -270,7 +272,7 @@
                 failed = failed || status == FAILED;
             }
             if (done) {
-                delegate.onCompletion(group, failed ? 1 : 0);
+                delegate.onCompletion(group, failed ? FAILED : SUCCEEDED);
             }
         }
     }
@@ -296,9 +298,9 @@
         }
 
         @Override
-        public void onCompletion(Step step, int exitCode) {
-            store.markComplete(step, exitCode == 0 ? SUCCEEDED : FAILED);
-            listeners.forEach(listener -> listener.onCompletion(step, exitCode));
+        public void onCompletion(Step step, Status status) {
+            store.markComplete(step, status);
+            listeners.forEach(listener -> listener.onCompletion(step, status));
             executeSucessors(step);
             latch.countDown();
         }
diff --git a/utils/stc/src/main/java/org/onlab/stc/Main.java b/utils/stc/src/main/java/org/onlab/stc/Main.java
index 567aaa6..bcb259d 100644
--- a/utils/stc/src/main/java/org/onlab/stc/Main.java
+++ b/utils/stc/src/main/java/org/onlab/stc/Main.java
@@ -172,8 +172,8 @@
         }
 
         @Override
-        public void onCompletion(Step step, int exitCode) {
-            logStatus(currentTimeMillis(), step.name(), exitCode == 0 ? SUCCEEDED : FAILED);
+        public void onCompletion(Step step, Status status) {
+            logStatus(currentTimeMillis(), step.name(), status);
         }
 
         @Override
diff --git a/utils/stc/src/main/java/org/onlab/stc/StepProcessListener.java b/utils/stc/src/main/java/org/onlab/stc/StepProcessListener.java
index 2c751a1..421a606 100644
--- a/utils/stc/src/main/java/org/onlab/stc/StepProcessListener.java
+++ b/utils/stc/src/main/java/org/onlab/stc/StepProcessListener.java
@@ -31,10 +31,10 @@
     /**
      * Indicates that process step has completed.
      *
-     * @param step     subject step
-     * @param exitCode step process exit exitCode
+     * @param step   subject step
+     * @param status step completion status
      */
-    default void onCompletion(Step step, int exitCode) {
+    default void onCompletion(Step step, Coordinator.Status status) {
     }
 
     /**
diff --git a/utils/stc/src/main/java/org/onlab/stc/StepProcessor.java b/utils/stc/src/main/java/org/onlab/stc/StepProcessor.java
index 95d5c86..86315e9 100644
--- a/utils/stc/src/main/java/org/onlab/stc/StepProcessor.java
+++ b/utils/stc/src/main/java/org/onlab/stc/StepProcessor.java
@@ -15,6 +15,8 @@
  */
 package org.onlab.stc;
 
+import org.onlab.stc.Coordinator.Status;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
@@ -23,6 +25,8 @@
 import java.io.PrintWriter;
 
 import static java.lang.String.format;
+import static org.onlab.stc.Coordinator.Status.FAILED;
+import static org.onlab.stc.Coordinator.Status.SUCCEEDED;
 import static org.onlab.stc.Coordinator.print;
 
 /**
@@ -30,12 +34,12 @@
  */
 class StepProcessor implements Runnable {
 
+    private static final String IGNORE_CODE = "~";
     private static final int FAIL = -1;
 
     static String launcher = "stc-launcher ";
 
     private final Step step;
-    private final boolean skip;
     private final File logDir;
 
     private Process process;
@@ -45,25 +49,22 @@
      * Creates a process monitor.
      *
      * @param step     step or group to be executed
-     * @param skip     indicates the process should not actually execute
      * @param logDir   directory where step process log should be stored
      * @param delegate process lifecycle listener
      */
-    StepProcessor(Step step, boolean skip, File logDir, StepProcessListener delegate) {
+    StepProcessor(Step step, File logDir, StepProcessListener delegate) {
         this.step = step;
-        this.skip = skip;
         this.logDir = logDir;
         this.delegate = delegate;
     }
 
     @Override
     public void run() {
-        int code = FAIL;
         delegate.onStart(step);
-        if (!skip) {
-            code = execute();
-        }
-        delegate.onCompletion(step, code);
+        int code = execute();
+        boolean ignoreCode = step.env() != null && step.env.equals(IGNORE_CODE);
+        Status status = ignoreCode || code == 0 ? SUCCEEDED : FAILED;
+        delegate.onCompletion(step, status);
     }
 
     /**
diff --git a/utils/stc/src/test/java/org/onlab/stc/CoordinatorTest.java b/utils/stc/src/test/java/org/onlab/stc/CoordinatorTest.java
index 67655f1..5174598 100644
--- a/utils/stc/src/test/java/org/onlab/stc/CoordinatorTest.java
+++ b/utils/stc/src/test/java/org/onlab/stc/CoordinatorTest.java
@@ -68,8 +68,8 @@
         }
 
         @Override
-        public void onCompletion(Step step, int exitCode) {
-            print("< %s: %s", step.name(), exitCode == 0 ? "completed" : "failed");
+        public void onCompletion(Step step, Coordinator.Status status) {
+            print("< %s: %s", step.name(), status == Coordinator.Status.SUCCEEDED ? "completed" : "failed");
         }
 
         @Override
diff --git a/utils/stc/src/test/java/org/onlab/stc/StepProcessorTest.java b/utils/stc/src/test/java/org/onlab/stc/StepProcessorTest.java
index d87372f..d074a62 100644
--- a/utils/stc/src/test/java/org/onlab/stc/StepProcessorTest.java
+++ b/utils/stc/src/test/java/org/onlab/stc/StepProcessorTest.java
@@ -23,7 +23,9 @@
 import java.io.File;
 import java.io.IOException;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.onlab.stc.Coordinator.Status.SUCCEEDED;
 
 /**
  * Test of the step processor.
@@ -46,31 +48,19 @@
     }
 
     @Test
-    public void executed() {
+    public void basics() {
         Step step = new Step("foo", "ls /tmp", null, null, null);
-        StepProcessor processor = new StepProcessor(step, false, DIR, delegate);
+        StepProcessor processor = new StepProcessor(step, DIR, delegate);
         processor.run();
         assertTrue("should be started", delegate.started);
         assertTrue("should have output", delegate.output);
         assertTrue("should be stopped", delegate.stopped);
-        assertEquals("incorrect code", 0, delegate.code);
-    }
-
-
-    @Test
-    public void skipped() {
-        Step step = new Step("foo", "ls /tmp", null, null, null);
-        StepProcessor processor = new StepProcessor(step, true, DIR, delegate);
-        processor.run();
-        assertTrue("should be started", delegate.started);
-        assertFalse("should have output", delegate.output);
-        assertTrue("should be stopped", delegate.stopped);
-        assertEquals("incorrect code", -1, delegate.code);
+        assertEquals("incorrect status", SUCCEEDED, delegate.status);
     }
 
     private class Listener implements StepProcessListener {
 
-        private int code = 123;
+        private Coordinator.Status status;
         private boolean started, stopped, output;
 
         @Override
@@ -79,9 +69,9 @@
         }
 
         @Override
-        public void onCompletion(Step step, int exitCode) {
+        public void onCompletion(Step step, Coordinator.Status status) {
             stopped = true;
-            this.code = exitCode;
+            this.status = status;
         }
 
         @Override
