Skip to content

Commit

Permalink
update test components (#70)
Browse files Browse the repository at this point in the history
* update CephVersion

* use tracing instead of log

* fix rados_striper example

* update test components

0. rust to 1.46.0
1. rustup to 1.22.1
1. ubuntu to focal
  • Loading branch information
light4 authored and mzhong1 committed Nov 9, 2020
1 parent 8497ccc commit 33cf5bf
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sudo: false
dist: trusty
dist: focal

language: rust

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ travis-ci = { repository = "ceph/ceph-rust", branch = "master" }
bitflags = "1.2.1"
byteorder = "1"
libc = "~0.2"
log = "~0.4"
nom = "5"
serde_derive = "1"
serde = "1"
serde_json = "1"
uuid = { version = "~0.8", features = ["serde"] }
nix = "0.18"
tracing = "0.1"

[features]
default = []
Expand Down
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
FROM buildpack-deps:xenial
FROM buildpack-deps:focal

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.38.0
RUST_VERSION=1.46.0

RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='36285482ae5c255f2decfab27d32ba19465804cb3ddf5a23e6ff2a7b0f6e0250' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='cb20e54566d4b13434dea1776a961cf7f97afcc292cb4b0fec533503dd2434d0' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='58e19ae12101103ccc50b04a2579b9238163f87a27da5078cefc900098f257ab' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='d3c42fb8b25f87eb049b6177611eea7d4fd51273de4113706f43cccf5610cfc7' ;; \
amd64) rustArch='x86_64-unknown-linux-gnu';; \
armhf) rustArch='armv7-unknown-linux-gnueabihf';; \
arm64) rustArch='aarch64-unknown-linux-gnu';; \
i386) rustArch='i686-unknown-linux-gnu';; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.19.0/${rustArch}/rustup-init"; \
url="https://static.rust-lang.org/rustup/archive/1.22.1/${rustArch}/rustup-init"; \
wget "$url"; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
wget "$url.sha256"; \
sed -i 's/target.*/rustup-init/g' rustup-init.sha256; \
sha256sum -c rustup-init.sha256; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION; \
rm rustup-init; \
Expand Down
13 changes: 4 additions & 9 deletions examples/rados_striper.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
extern crate ceph;
extern crate nix;







#[cfg(feature = "rados_striper")]
use {ceph::ceph as ceph_helpers, ceph::error::RadosError, nix::errno::Errno};

use std::env;
use std::str;

#[cfg(not(feature = "rados_striper"))]
fn main() {}
Expand Down
19 changes: 5 additions & 14 deletions src/ceph_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mod tests {
}
}

#[non_exhaustive]
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub enum CephVersion {
Argonaut,
Expand All @@ -37,6 +38,7 @@ pub enum CephVersion {
Luminous,
Mimic,
Nautilus,
Octopus,
}

impl FromStr for CephVersion {
Expand All @@ -54,6 +56,7 @@ impl FromStr for CephVersion {
(version_parts.next(), version_parts.next(), version_parts.next())
{
match major {
"15" => return Ok(Octopus),
"14" => return Ok(Nautilus),
"13" => return Ok(Mimic),
"12" => return Ok(Luminous),
Expand All @@ -69,24 +72,12 @@ impl FromStr for CephVersion {
"61" => return Ok(Cuttlefish),
"56" => return Ok(Bobtail),
"48" => return Ok(Argonaut),
_ => {},
_ => {}
},
_ => {},
_ => {}
}
}
}
Err(RadosError::Parse(s.into()))
}
}

// impl Ord for CephVersion {
// fn cmp(&self, other: &CephVersion) -> Ordering {
// self.height.cmp(&other.height)
// }
// }

// impl PartialOrd for CephVersion {
// fn partial_cmp(&self, other: &CephVersion) -> Option<Ordering> {
// Some(self.cmp(other))
// }
// }
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extern crate bitflags;
extern crate byteorder;
extern crate libc;
#[macro_use]
extern crate log;
extern crate tracing;
#[macro_use]
extern crate nom;
extern crate serde;
Expand Down

0 comments on commit 33cf5bf

Please sign in to comment.