mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 04:53:40 +00:00
0.2.5 initial commit
Makefile incomplete
This commit is contained in:
20
agent/test/ChecklistSpec.hs
Normal file
20
agent/test/ChecklistSpec.hs
Normal file
@@ -0,0 +1,20 @@
|
||||
module ChecklistSpec where
|
||||
|
||||
import Startlude
|
||||
|
||||
import Data.List ( (!!) )
|
||||
import Data.Text
|
||||
import System.Directory
|
||||
import Test.Hspec
|
||||
|
||||
import Constants
|
||||
import Lib.Synchronizers
|
||||
|
||||
spec :: Spec
|
||||
spec = describe "Current Version" $ do
|
||||
it "Requires System Synchronizer" $ do
|
||||
agentVersion `shouldSatisfy` (synchronizerVersion synchronizer ==)
|
||||
it "Requires Migration Target" $ do
|
||||
names <- liftIO $ listDirectory "migrations"
|
||||
let targets = names <&> (fromString . toS . (!! 1) . (splitOn "::") . toS)
|
||||
agentVersion `shouldSatisfy` flip elem targets
|
||||
77
agent/test/Lib/External/AppManifestSpec.hs
vendored
Normal file
77
agent/test/Lib/External/AppManifestSpec.hs
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
module Lib.External.AppManifestSpec where
|
||||
|
||||
import Startlude
|
||||
|
||||
import Test.Hspec
|
||||
|
||||
import Data.String.Interpolate.IsString
|
||||
import Data.Yaml
|
||||
|
||||
import Lib.External.AppManifest
|
||||
|
||||
cups023Manifest :: ByteString
|
||||
cups023Manifest = [i|
|
||||
---
|
||||
compat: v0
|
||||
id: cups
|
||||
version: 0.2.3
|
||||
title: Cups
|
||||
description:
|
||||
short: Peer-to-Peer Encrypted Messaging
|
||||
long: A peer-to-peer encrypted messaging platform that operates over tor.
|
||||
release-notes: fix autofill for password field
|
||||
ports:
|
||||
- internal: 59001
|
||||
tor: 59001
|
||||
- internal: 80
|
||||
tor: 80
|
||||
image:
|
||||
type: tar
|
||||
mount: /root
|
||||
assets:
|
||||
- src: httpd.conf
|
||||
dst: "."
|
||||
overwrite: true
|
||||
- src: www
|
||||
dst: "."
|
||||
overwrite: true
|
||||
hidden-service-version: v3
|
||||
|]
|
||||
|
||||
cups023ManifestModNoUI :: ByteString
|
||||
cups023ManifestModNoUI = [i|
|
||||
---
|
||||
compat: v0
|
||||
id: cups
|
||||
version: 0.2.3
|
||||
title: Cups
|
||||
description:
|
||||
short: Peer-to-Peer Encrypted Messaging
|
||||
long: A peer-to-peer encrypted messaging platform that operates over tor.
|
||||
release-notes: fix autofill for password field
|
||||
ports:
|
||||
- internal: 59001
|
||||
tor: 59001
|
||||
image:
|
||||
type: tar
|
||||
mount: /root
|
||||
assets:
|
||||
- src: httpd.conf
|
||||
dst: "."
|
||||
overwrite: true
|
||||
- src: www
|
||||
dst: "."
|
||||
overwrite: true
|
||||
hidden-service-version: v3
|
||||
|]
|
||||
|
||||
spec :: Spec
|
||||
spec = do
|
||||
describe "parsing app manifest ports" $ do
|
||||
it "should yield true for cups 0.2.3" $ do
|
||||
res <- decodeThrow @IO @(AppManifest 0) cups023Manifest
|
||||
uiAvailable res `shouldBe` True
|
||||
it "should yield false for cups 0.2.3 Mod" $ do
|
||||
res <- decodeThrow @IO @(AppManifest 0) cups023ManifestModNoUI
|
||||
uiAvailable res `shouldBe` False
|
||||
16
agent/test/Lib/SoundSpec.hs
Normal file
16
agent/test/Lib/SoundSpec.hs
Normal file
@@ -0,0 +1,16 @@
|
||||
module Lib.SoundSpec where
|
||||
|
||||
import Startlude
|
||||
|
||||
import Test.Hspec
|
||||
|
||||
import Lib.Sound
|
||||
|
||||
spec :: Spec
|
||||
spec = describe "Sound Interface" $ do
|
||||
it "Async sound actions should be FIFO" $ do
|
||||
action <- async $ playSongTimed 400 marioDeath
|
||||
action' <- async $ playSongTimed 400 marioDeath
|
||||
marks0 <- wait action
|
||||
marks1 <- wait action'
|
||||
(marks0, marks1) `shouldSatisfy` \((s0, f0), (s1, f1)) -> s1 > s0 && s1 > f0 || s0 > s1 && s0 > f1
|
||||
149
agent/test/Lib/Types/EmverProp.hs
Normal file
149
agent/test/Lib/Types/EmverProp.hs
Normal file
@@ -0,0 +1,149 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Lib.Types.EmverProp where
|
||||
|
||||
import Startlude hiding ( Any )
|
||||
|
||||
import Hedgehog as Test
|
||||
import Lib.Types.Emver
|
||||
import Hedgehog.Range
|
||||
import Hedgehog.Gen as Gen
|
||||
import qualified Data.Attoparsec.Text as Atto
|
||||
|
||||
versionGen :: MonadGen m => m Version
|
||||
versionGen = do
|
||||
a <- word (linear 0 30)
|
||||
b <- word (linear 0 30)
|
||||
c <- word (linear 0 30)
|
||||
d <- word (linear 0 30)
|
||||
pure $ Version (a, b, c, d)
|
||||
|
||||
rangeGen :: MonadGen m => m VersionRange
|
||||
rangeGen = choice [pure None, pure Any, anchorGen, disjGen, conjGen]
|
||||
|
||||
anchorGen :: MonadGen m => m VersionRange
|
||||
anchorGen = do
|
||||
c <- element [LT, EQ, GT]
|
||||
f <- element [Left, Right]
|
||||
Anchor (f c) <$> versionGen
|
||||
|
||||
conjGen :: MonadGen m => m VersionRange
|
||||
conjGen = liftA2 conj rangeGen rangeGen
|
||||
|
||||
disjGen :: MonadGen m => m VersionRange
|
||||
disjGen = liftA2 disj rangeGen rangeGen
|
||||
|
||||
prop_conjAssoc :: Property
|
||||
prop_conjAssoc = property $ do
|
||||
a <- forAll rangeGen
|
||||
b <- forAll rangeGen
|
||||
c <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
(obs <|| conj a (conj b c)) === (obs <|| conj (conj a b) c)
|
||||
|
||||
prop_conjCommut :: Property
|
||||
prop_conjCommut = property $ do
|
||||
a <- forAll rangeGen
|
||||
b <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
(obs <|| conj a b) === (obs <|| conj b a)
|
||||
|
||||
prop_disjAssoc :: Property
|
||||
prop_disjAssoc = property $ do
|
||||
a <- forAll rangeGen
|
||||
b <- forAll rangeGen
|
||||
c <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
(obs <|| disj a (disj b c)) === (obs <|| disj (disj a b) c)
|
||||
|
||||
prop_disjCommut :: Property
|
||||
prop_disjCommut = property $ do
|
||||
a <- forAll rangeGen
|
||||
b <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
(obs <|| disj a b) === (obs <|| disj b a)
|
||||
|
||||
prop_anyIdentConj :: Property
|
||||
prop_anyIdentConj = property $ do
|
||||
a <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
obs <|| conj Any a === obs <|| a
|
||||
|
||||
prop_noneIdentDisj :: Property
|
||||
prop_noneIdentDisj = property $ do
|
||||
a <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
obs <|| disj None a === obs <|| a
|
||||
|
||||
prop_noneAnnihilatesConj :: Property
|
||||
prop_noneAnnihilatesConj = property $ do
|
||||
a <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
obs <|| conj None a === obs <|| None
|
||||
|
||||
prop_anyAnnihilatesDisj :: Property
|
||||
prop_anyAnnihilatesDisj = property $ do
|
||||
a <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
obs <|| disj Any a === obs <|| Any
|
||||
|
||||
prop_conjDistributesOverDisj :: Property
|
||||
prop_conjDistributesOverDisj = property $ do
|
||||
a <- forAll rangeGen
|
||||
b <- forAll rangeGen
|
||||
c <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
obs <|| conj a (disj b c) === obs <|| disj (conj a b) (conj a c)
|
||||
|
||||
prop_disjDistributesOverConj :: Property
|
||||
prop_disjDistributesOverConj = property $ do
|
||||
a <- forAll rangeGen
|
||||
b <- forAll rangeGen
|
||||
c <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
obs <|| disj a (conj b c) === obs <|| conj (disj a b) (disj a c)
|
||||
|
||||
prop_anyAcceptsAny :: Property
|
||||
prop_anyAcceptsAny = property $ do
|
||||
obs <- forAll versionGen
|
||||
assert $ obs <|| Any
|
||||
|
||||
prop_noneAcceptsNone :: Property
|
||||
prop_noneAcceptsNone = property $ do
|
||||
obs <- forAll versionGen
|
||||
assert . not $ obs <|| None
|
||||
|
||||
prop_conjBoth :: Property
|
||||
prop_conjBoth = property $ do
|
||||
a <- forAll rangeGen
|
||||
b <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
(obs <|| conj a b) === (obs <|| a && obs <|| b)
|
||||
|
||||
prop_disjEither :: Property
|
||||
prop_disjEither = property $ do
|
||||
a <- forAll rangeGen
|
||||
b <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
(obs <|| disj a b) === (obs <|| a || obs <|| b)
|
||||
|
||||
prop_rangeParseRoundTrip :: Property
|
||||
prop_rangeParseRoundTrip = withShrinks 0 . property $ do
|
||||
a <- forAll rangeGen
|
||||
obs <- forAll versionGen
|
||||
when (a == None) Test.discard
|
||||
-- we do not use 'tripping' here since 'tripping' requires equality of representation
|
||||
-- we only want to check equality up to OBSERVATION
|
||||
(satisfies obs <$> Atto.parseOnly parseRange (show a)) === Right (satisfies obs a)
|
||||
|
||||
prop_anchorLeftIsNegatedRight :: Property
|
||||
prop_anchorLeftIsNegatedRight = property $ do
|
||||
a <- forAll anchorGen
|
||||
neg <- case a of
|
||||
Anchor (Right o) v -> pure $ Anchor (Left o) v
|
||||
Anchor (Left o) v -> pure $ Anchor (Right o) v
|
||||
_ -> Test.discard
|
||||
obs <- forAll versionGen
|
||||
obs <|| a /== obs <|| neg
|
||||
|
||||
tests :: IO Bool
|
||||
tests = checkParallel $ $$discover
|
||||
22
agent/test/Live/Metrics.hs
Normal file
22
agent/test/Live/Metrics.hs
Normal file
@@ -0,0 +1,22 @@
|
||||
module Live.Metrics where
|
||||
|
||||
import Lib.External.Metrics.Df
|
||||
import Lib.External.Metrics.Iotop
|
||||
import Lib.External.Metrics.ProcDev
|
||||
import Lib.External.Metrics.Top
|
||||
import Startlude
|
||||
|
||||
parseIotopOutput :: IO IotopMetrics
|
||||
parseIotopOutput = parseIotop <$> readFile "./test/Live/iotop.sample"
|
||||
|
||||
parseTopOutput :: IO TopMetrics
|
||||
parseTopOutput = parseTop <$> readFile "./test/Live/top.sample"
|
||||
|
||||
parseDfOutput :: IO DfMetrics
|
||||
parseDfOutput = parseDf <$> readFile "./test/Live/df.sample"
|
||||
|
||||
parseProcDevOutput :: IO (UTCTime, ProcDevMomentStats)
|
||||
parseProcDevOutput = do
|
||||
res <- readFile "./test/Live/procDev.sample"
|
||||
now <- getCurrentTime
|
||||
pure $ parseProcDev now res
|
||||
30
agent/test/Live/Serialize.hs
Normal file
30
agent/test/Live/Serialize.hs
Normal file
@@ -0,0 +1,30 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
module Live.Serialize where
|
||||
|
||||
import Startlude hiding ( runReader )
|
||||
|
||||
import Control.Carrier.Lift
|
||||
import Data.String.Interpolate.IsString
|
||||
|
||||
import Application
|
||||
import Lib.Algebra.State.RegistryUrl
|
||||
import Lib.External.Registry
|
||||
import Lib.SystemPaths
|
||||
|
||||
someYaml :: ByteString
|
||||
someYaml = [i|
|
||||
bitcoind:
|
||||
title: "Bitcoin Core"
|
||||
description:
|
||||
short: "A Bitcoin Full Node"
|
||||
long: "The bitcoin full node implementation by Bitcoin Core."
|
||||
version-info:
|
||||
- version: 0.18.1
|
||||
release-notes: "Some stuff"
|
||||
icon-type: png
|
||||
|]
|
||||
|
||||
appRegistryTest :: IO (Either String AppManifestRes)
|
||||
appRegistryTest = do
|
||||
settings <- getAppSettings
|
||||
runM . injectFilesystemBaseFromContext settings . runRegistryUrlIOC $ parseBsManifest someYaml
|
||||
2
agent/test/Live/df.sample
Normal file
2
agent/test/Live/df.sample
Normal file
@@ -0,0 +1,2 @@
|
||||
Filesystem 1K-blocks Used Available Use% Mounted on
|
||||
/dev/root 30391116 16800060 12320856 58% /
|
||||
119
agent/test/Live/iotop.sample
Normal file
119
agent/test/Live/iotop.sample
Normal file
@@ -0,0 +1,119 @@
|
||||
Total DISK READ : 0.00 B/s | Total DISK WRITE : 0.00 B/s
|
||||
Actual DISK READ: 0.00 B/s | Actual DISK WRITE: 0.00 B/s
|
||||
TID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
|
||||
1 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % init
|
||||
2 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthreadd]
|
||||
4 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/0:0H]
|
||||
6 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [mm_percpu_wq]
|
||||
7 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksoftirqd/0]
|
||||
8 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_sched]
|
||||
9 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_bh]
|
||||
10 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [migration/0]
|
||||
11 rt/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdog/0]
|
||||
12 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [cpuhp/0]
|
||||
13 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kdevtmpfs]
|
||||
14 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [netns]
|
||||
15 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rcu_tasks_kthre]
|
||||
16 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kauditd]
|
||||
17 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [khungtaskd]
|
||||
18 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [oom_reaper]
|
||||
19 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [writeback]
|
||||
20 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kcompactd0]
|
||||
21 be/5 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ksmd]
|
||||
22 be/7 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [khugepaged]
|
||||
23 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [crypto]
|
||||
24 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kintegrityd]
|
||||
25 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kblockd]
|
||||
26 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ata_sff]
|
||||
27 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [md]
|
||||
28 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [edac-poller]
|
||||
29 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [devfreq_wq]
|
||||
30 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [watchdogd]
|
||||
34 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kswapd0]
|
||||
35 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/u3:0]
|
||||
36 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ecryptfs-kthrea]
|
||||
78 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kthrotld]
|
||||
79 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [acpi_thermal_pm]
|
||||
80 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [scsi_eh_0]
|
||||
81 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [scsi_tmf_0]
|
||||
82 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [scsi_eh_1]
|
||||
83 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [scsi_tmf_1]
|
||||
89 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ipv6_addrconf]
|
||||
98 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kstrp]
|
||||
115 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [charger_manager]
|
||||
155 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [scsi_eh_2]
|
||||
156 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [scsi_tmf_2]
|
||||
157 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/0:1H]
|
||||
268 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [raid5wq]
|
||||
321 be/3 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [jbd2/vda1-8]
|
||||
322 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ext4-rsv-conver]
|
||||
391 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [iscsi_eh]
|
||||
392 be/3 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % systemd-journald
|
||||
406 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lvmetad -f
|
||||
408 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ib-comp-wq]
|
||||
410 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ib-comp-unb-wq]
|
||||
411 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ib_mcast]
|
||||
415 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [ib_nl_sa_wq]
|
||||
418 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [rdma_cm]
|
||||
530 be/4 systemd- 0.00 B/s 0.00 B/s 0.00 % 0.00 % systemd-timesyncd
|
||||
577 be/4 systemd- 0.00 B/s 0.00 B/s 0.00 % 0.00 % systemd-timesyncd [sd-resolve]
|
||||
613 be/4 systemd- 0.00 B/s 0.00 B/s 0.00 % 0.00 % systemd-networkd
|
||||
633 be/4 systemd- 0.00 B/s 0.00 B/s 0.00 % 0.00 % systemd-resolved
|
||||
711 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % systemd-udevd
|
||||
797 be/4 syslog 0.00 B/s 0.00 B/s 0.00 % 0.00 % rsyslogd -n
|
||||
811 be/4 syslog 0.00 B/s 0.00 B/s 0.00 % 0.00 % rsyslogd -n [in:imuxsock]
|
||||
812 be/4 syslog 0.00 B/s 0.00 B/s 0.00 % 0.00 % rsyslogd -n [in:imklog]
|
||||
813 be/4 syslog 0.00 B/s 0.00 B/s 0.00 % 0.00 % rsyslogd -n [rs:main Q:Reg]
|
||||
799 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % cron -f
|
||||
802 be/4 daemon 0.00 B/s 0.00 B/s 0.00 % 0.00 % atd -f
|
||||
803 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % python3 /usr/bin/networkd-dispatcher --run-startup-triggers
|
||||
889 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % python3 /usr/bin/networkd-dispatcher --run-startup-triggers [gmain]
|
||||
805 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % systemd-logind
|
||||
807 be/4 messageb 0.00 B/s 0.00 B/s 0.00 % 0.00 % dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
|
||||
817 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
9445 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
9446 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
19695 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
19699 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
23977 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
23982 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
23983 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
23984 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
23986 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
23987 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % lxcfs /var/lib/lxcfs/
|
||||
819 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % accounts-daemon
|
||||
833 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % accounts-daemon [gmain]
|
||||
835 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % accounts-daemon [gdbus]
|
||||
825 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220
|
||||
828 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % agetty -o -p -- \u --noclear tty1 linux
|
||||
829 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
|
||||
891 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal [gmain]
|
||||
838 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % polkitd --no-debug
|
||||
840 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % polkitd --no-debug [gmain]
|
||||
844 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % polkitd --no-debug [gdbus]
|
||||
839 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % sshd -D
|
||||
22492 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % systemd --user
|
||||
22493 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % (sd-pam)
|
||||
22585 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % tmux
|
||||
22586 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % -bash
|
||||
22597 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % ./start9-registry
|
||||
22598 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % ./start9-registry [ghc_ticker]
|
||||
22599 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % ./start9-registry [start9-regist:w]
|
||||
22600 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % ./start9-registry [start9-regist:w]
|
||||
22601 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % ./start9-registry [start9-regist:w]
|
||||
22602 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % ./start9-registry [start9-regist:w]
|
||||
22686 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % ./start9-registry [start9-regist:w]
|
||||
22953 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % ./start9-registry [start9-regist:w]
|
||||
23052 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/0:2]
|
||||
23761 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/u2:1]
|
||||
23861 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/u2:2]
|
||||
23946 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/0:0]
|
||||
24091 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % sshd: root@pts/0
|
||||
24198 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % -bash
|
||||
24264 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/u2:0]
|
||||
24265 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/u2:3]
|
||||
24266 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/u2:4]
|
||||
24336 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [kworker/0:1]
|
||||
24407 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % python3 /usr/sbin/iotop -bn1
|
||||
29224 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [xfsalloc]
|
||||
29227 be/0 root 0.00 B/s 0.00 B/s 0.00 % 0.00 % [xfs_mru_cache]
|
||||
15
agent/test/Live/lscpu.sample
Normal file
15
agent/test/Live/lscpu.sample
Normal file
@@ -0,0 +1,15 @@
|
||||
Architecture: armv7l
|
||||
Byte Order: Little Endian
|
||||
CPU(s): 4
|
||||
On-line CPU(s) list: 0-3
|
||||
Thread(s) per core: 1
|
||||
Core(s) per socket: 4
|
||||
Socket(s): 1
|
||||
Vendor ID: ARM
|
||||
Model: 3
|
||||
Model name: Cortex-A72
|
||||
Stepping: r0p3
|
||||
CPU max MHz: 1500.0000
|
||||
CPU min MHz: 600.0000
|
||||
BogoMIPS: 270.00
|
||||
Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
|
||||
6
agent/test/Live/procDev.sample
Executable file
6
agent/test/Live/procDev.sample
Executable file
@@ -0,0 +1,6 @@
|
||||
Inter-| Receive | Transmit
|
||||
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
|
||||
eth0: 1490932684 1431621 0 0 0 0 0 0 1725610837 1054325 0 0 0 0 0 0
|
||||
eth1: 1000000000 1000000 0 0 0 0 0 0 1000000000 1000000 0 0 0 0 0 0
|
||||
eth2: fuck askksf oijefoijsf everythign is dicked maodsfijoijther shit bals.
|
||||
lo: 51480 488 0 0 0 0 0 0 51480 488 0 0 0 0 0 0
|
||||
2
agent/test/Live/test-configure-bitcoind
Normal file
2
agent/test/Live/test-configure-bitcoind
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
curl -k --header "Content-Type: application/json" --request PATCH --data '{"rpcuser":"bitcoin","rpcpassword":"shitcoin"}' https://localhost:5959/v0/apps/installed/bitcoind/config
|
||||
2
agent/test/Live/test-install-bitcoind
Normal file
2
agent/test/Live/test-install-bitcoind
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
curl -k --header "Content-Type: application/json" --request POST --data '{"id":"bitcoind","version":"0.18.1"}' https://localhost:5959/v0/apps/install
|
||||
3
agent/test/Live/test-register
Executable file
3
agent/test/Live/test-register
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -k --header "Content-Type: application/json" --request POST --data '{"productKey":"abcdefgh","pubKey":"03df51984d6b8b8b1cc693e239491f77a36c9e9dfe4a486e9972a18e03610a0d22"}' https://localhost:5959/v0/register
|
||||
3
agent/test/Live/test-self-update
Executable file
3
agent/test/Live/test-self-update
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
curl -k --header "Content-Type: application/json" --request POST --data '{"versionSpecification":">=0.0.0"}' https://localhost:5959/v0/update
|
||||
|
||||
130
agent/test/Live/top.sample
Normal file
130
agent/test/Live/top.sample
Normal file
@@ -0,0 +1,130 @@
|
||||
top - 20:41:46 up 15:49, 1 user, load average: 3.28, 3.29, 3.01
|
||||
Tasks: 123 total, 1 running, 122 sleeping, 0 stopped, 0 zombie
|
||||
%Cpu(s): 3.0 us, 4.5 sy, 0.0 ni, 50.7 id, 41.8 wa, 0.0 hi, 0.0 si, 0.0 st
|
||||
MiB Mem : 3906.0 total, 568.4 free, 799.6 used, 2538.1 buff/cache
|
||||
MiB Swap: 100.0 total, 31.5 free, 68.5 used. 2960.4 avail Mem
|
||||
|
||||
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||
983 root 20 0 777140 586900 2264 S 6.2 14.7 363:41.88 bitcoind
|
||||
1 root 20 0 33700 5376 4344 S 0.0 0.1 0:03.90 systemd
|
||||
2 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kthreadd
|
||||
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
|
||||
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp
|
||||
8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq
|
||||
9 root 20 0 0 0 0 S 0.0 0.0 0:14.62 ksoftirqd/0
|
||||
10 root 20 0 0 0 0 I 0.0 0.0 0:40.13 rcu_sched
|
||||
11 root 20 0 0 0 0 I 0.0 0.0 0:00.00 rcu_bh
|
||||
12 root rt 0 0 0 0 S 0.0 0.0 0:00.02 migration/0
|
||||
13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
|
||||
14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1
|
||||
15 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/1
|
||||
16 root 20 0 0 0 0 S 0.0 0.0 0:01.66 ksoftirqd/1
|
||||
19 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/2
|
||||
20 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/2
|
||||
21 root 20 0 0 0 0 S 0.0 0.0 0:03.19 ksoftirqd/2
|
||||
24 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/3
|
||||
25 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/3
|
||||
26 root 20 0 0 0 0 S 0.0 0.0 0:01.87 ksoftirqd/3
|
||||
29 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
|
||||
30 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 netns
|
||||
34 root 20 0 0 0 0 S 0.0 0.0 0:00.03 khungtaskd
|
||||
35 root 20 0 0 0 0 S 0.0 0.0 0:00.00 oom_reaper
|
||||
36 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 writeback
|
||||
37 root 20 0 0 0 0 S 0.0 0.0 0:01.78 kcompactd0
|
||||
38 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 crypto
|
||||
39 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kblockd
|
||||
41 root rt 0 0 0 0 S 0.0 0.0 0:00.00 watchdogd
|
||||
42 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rpciod
|
||||
43 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/u9:0-hci0
|
||||
44 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 xprtiod
|
||||
47 root 20 0 0 0 0 S 0.0 0.0 0:50.55 kswapd0
|
||||
48 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 nfsiod
|
||||
59 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kthrotld
|
||||
60 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 iscsi_eh
|
||||
62 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 dwc_otg
|
||||
64 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 DWC Notificatio
|
||||
65 root 1 -19 0 0 0 S 0.0 0.0 0:00.00 vchiq-slot/0
|
||||
66 root 1 -19 0 0 0 S 0.0 0.0 0:00.00 vchiq-recy/0
|
||||
67 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 vchiq-sync/0
|
||||
68 root 20 0 0 0 0 S 0.0 0.0 0:00.00 vchiq-keep/0
|
||||
69 root 10 -10 0 0 0 S 0.0 0.0 0:00.00 SMIO
|
||||
71 root -51 0 0 0 0 S 0.0 0.0 0:00.00 irq/38-brcmstb_
|
||||
72 root -51 0 0 0 0 S 0.0 0.0 0:00.65 irq/39-mmc1
|
||||
74 root -51 0 0 0 0 S 0.0 0.0 0:00.00 irq/39-mmc0
|
||||
75 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mmc_complete
|
||||
79 root 20 0 0 0 0 D 0.0 0.0 0:22.44 jbd2/mmcblk0p2-
|
||||
80 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 ext4-rsv-conver
|
||||
84 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 ipv6_addrconf
|
||||
123 root 20 0 21216 6296 5424 S 0.0 0.2 0:02.12 systemd-journal
|
||||
148 root 20 0 18016 2648 1872 S 0.0 0.1 0:00.66 systemd-udevd
|
||||
182 root 10 -10 0 0 0 S 0.0 0.0 0:00.00 SMIO
|
||||
199 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mmal-vchiq
|
||||
203 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mmal-vchiq
|
||||
208 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mmal-vchiq
|
||||
217 root -2 0 0 0 0 S 0.0 0.0 0:00.00 v3d_bin
|
||||
218 root -2 0 0 0 0 S 0.0 0.0 0:00.00 v3d_render
|
||||
220 root -2 0 0 0 0 S 0.0 0.0 0:00.00 v3d_tfu
|
||||
221 root -2 0 0 0 0 S 0.0 0.0 0:00.00 v3d_csd
|
||||
222 root -2 0 0 0 0 S 0.0 0.0 0:00.00 v3d_cache_clean
|
||||
238 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 cfg80211
|
||||
241 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 brcmf_wq/mmc1:0
|
||||
242 root 20 0 0 0 0 S 0.0 0.0 0:00.38 brcmf_wdog/mmc1
|
||||
285 systemd+ 20 0 22380 3164 2676 S 0.0 0.1 0:00.46 systemd-timesyn
|
||||
328 nobody 20 0 4320 1516 1344 S 0.0 0.0 0:00.36 thd
|
||||
333 root 20 0 7944 1840 1656 S 0.0 0.0 0:00.13 cron
|
||||
335 root 39 19 3692 1768 1568 S 0.0 0.0 0:00.04 alsactl
|
||||
342 message+ 20 0 6556 2792 2324 S 0.0 0.1 0:00.25 dbus-daemon
|
||||
346 root 20 0 13092 4768 4152 S 0.0 0.1 0:00.30 systemd-logind
|
||||
349 root 20 0 27656 1068 928 S 0.0 0.0 0:06.77 rngd
|
||||
361 root 20 0 10708 2596 2188 S 0.0 0.1 0:00.28 wpa_supplicant
|
||||
362 root 20 0 25512 2764 2156 S 0.0 0.1 0:00.37 rsyslogd
|
||||
464 root 20 0 11088 3176 2716 S 0.0 0.1 0:00.50 wpa_supplicant
|
||||
487 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/u9:1-hci0
|
||||
488 root 20 0 2140 128 0 S 0.0 0.0 0:00.00 hciattach
|
||||
493 root 20 0 9536 1728 1448 S 0.0 0.0 0:00.03 bluetoothd
|
||||
548 root 20 0 3028 1600 1252 S 0.0 0.0 0:00.39 dhcpcd
|
||||
550 root 20 0 1007336 35764 11120 S 0.0 0.9 3:24.38 dockerd
|
||||
555 root 20 0 211952 27340 15432 S 0.0 0.7 40:34.92 agent
|
||||
592 root 20 0 4308 948 860 S 0.0 0.0 0:00.01 agetty
|
||||
618 root 20 0 10692 3804 3364 S 0.0 0.1 0:00.01 sshd
|
||||
619 debian-+ 20 0 34724 22244 5604 S 0.0 0.6 44:17.87 tor
|
||||
635 avahi 20 0 5904 2488 2144 S 0.0 0.1 0:03.10 avahi-daemon
|
||||
636 avahi 20 0 5772 244 0 S 0.0 0.0 0:00.00 avahi-daemon
|
||||
638 root 20 0 968328 9212 4604 S 0.0 0.2 2:38.54 docker-containe
|
||||
920 root 20 0 861496 976 556 S 0.0 0.0 0:00.06 docker-proxy
|
||||
934 root 20 0 861496 1032 620 S 0.0 0.0 0:00.05 docker-proxy
|
||||
948 root 20 0 852276 1032 620 S 0.0 0.0 0:00.04 docker-proxy
|
||||
961 root 20 0 852276 860 420 S 0.0 0.0 0:00.04 docker-proxy
|
||||
968 root 20 0 889864 2112 1148 S 0.0 0.1 0:07.54 docker-containe
|
||||
1332 Debian-+ 20 0 14096 2336 1888 S 0.0 0.1 0:00.04 exim4
|
||||
2987 root 0 -20 0 0 0 I 0.0 0.0 0:51.45 kworker/2:1H-kblockd
|
||||
3261 root 0 -20 0 0 0 I 0.0 0.0 0:40.57 kworker/1:0H-kblockd
|
||||
3580 root 0 -20 0 0 0 D 0.0 0.0 0:21.37 kworker/3:0H+kblockd
|
||||
4084 root 20 0 0 0 0 I 0.0 0.0 0:03.75 kworker/u8:0-events_unbound
|
||||
4155 root 0 -20 0 0 0 I 0.0 0.0 0:08.39 kworker/0:2H-mmc_complete
|
||||
4176 root 20 0 0 0 0 I 0.0 0.0 0:00.04 kworker/1:0-mm_percpu_wq
|
||||
4185 root 20 0 0 0 0 I 0.0 0.0 0:00.14 kworker/3:0-mm_percpu_wq
|
||||
4187 root 20 0 0 0 0 D 0.0 0.0 0:00.48 kworker/2:3+events_freezable
|
||||
4191 root 20 0 0 0 0 I 0.0 0.0 0:00.13 kworker/1:2-mm_percpu_wq
|
||||
4218 root 20 0 12204 6288 5364 S 0.0 0.2 0:00.04 sshd
|
||||
4224 pi 20 0 14564 6632 5788 S 0.0 0.2 0:00.14 systemd
|
||||
4227 pi 20 0 35240 2964 1636 S 0.0 0.1 0:00.00 (sd-pam)
|
||||
4241 pi 20 0 12204 4084 3140 S 0.0 0.1 0:00.44 sshd
|
||||
4244 pi 20 0 8492 3624 2704 S 0.0 0.1 0:00.24 bash
|
||||
4255 root 20 0 0 0 0 I 0.0 0.0 0:00.31 kworker/u8:1-events_unbound
|
||||
4256 root 20 0 0 0 0 I 0.0 0.0 0:00.06 kworker/2:2-events_power_efficient
|
||||
4270 root 20 0 0 0 0 I 0.0 0.0 0:00.11 kworker/0:1-events_power_efficient
|
||||
4307 root 20 0 0 0 0 I 0.0 0.0 0:00.00 kworker/3:2
|
||||
4326 root 0 -20 0 0 0 I 0.0 0.0 0:00.01 kworker/3:1H-kblockd
|
||||
4327 root 0 -20 0 0 0 I 0.0 0.0 0:00.01 kworker/2:2H-kblockd
|
||||
4337 root 0 -20 0 0 0 I 0.0 0.0 0:00.01 kworker/1:1H-kblockd
|
||||
4338 root 20 0 0 0 0 I 0.0 0.0 0:00.03 kworker/0:2-events
|
||||
4343 root 0 -20 0 0 0 I 0.0 0.0 0:00.01 kworker/0:0H-kblockd
|
||||
4382 root 20 0 0 0 0 I 0.0 0.0 0:00.02 kworker/2:0-mm_percpu_wq
|
||||
4389 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/2:0H-kblockd
|
||||
4390 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/3:2H
|
||||
4396 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/1:2H-kblockd
|
||||
4397 root 20 0 0 0 0 I 0.0 0.0 0:00.02 kworker/0:0-mm_percpu_wq
|
||||
4398 root 20 0 0 0 0 I 0.0 0.0 0:00.00 kworker/2:1-mm_percpu_wq
|
||||
4399 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:1H-kblockd
|
||||
4400 pi 20 0 10184 2828 2448 R 0.0 0.1 0:00.01 top
|
||||
13
agent/test/Main.hs
Normal file
13
agent/test/Main.hs
Normal file
@@ -0,0 +1,13 @@
|
||||
module Main where
|
||||
|
||||
import Startlude
|
||||
|
||||
import Test.Hspec.Runner
|
||||
import Test.Hspec.Formatters
|
||||
import qualified Spec
|
||||
import qualified Lib.Types.EmverProp as EmverProp
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
EmverProp.tests
|
||||
hspecWith defaultConfig { configFormatter = Just progress } Spec.spec
|
||||
1
agent/test/Spec.hs
Normal file
1
agent/test/Spec.hs
Normal file
@@ -0,0 +1 @@
|
||||
{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-}
|
||||
Reference in New Issue
Block a user